Overview
This guide walks through deploying a complete application to Dokploy, from connecting a Git repository to configuring domains and SSL. We’ll deploy a Node.js application, but the process is similar for other languages.What We’ll Deploy
In this tutorial, we’ll deploy a full-stack application with:- Frontend: React/Next.js application
- Database: PostgreSQL database
- Domain: Custom domain with automatic SSL
- Monitoring: Real-time logs and metrics
Prerequisites
Before starting, ensure you have:A Git repository
- GitHub
- GitLab
- Bitbucket
- Any Git-compatible service
Dokploy installed and running
http://your-server-ip:3000Domain name (optional)
Step 1: Create a Project
Projects help organize related applications and databases.Navigate to dashboard
Create project
- Click Create Project
- Enter project details:
- Click Create
Step 2: Set Up the Database
Most applications need a database. Let’s create a PostgreSQL database first.Create database
- Click the Databases tab
- Click Create Database
- Select PostgreSQL
Configure database
Set resource limits
Create and start
- Click Create Database
- Wait for the database to start (10-20 seconds)
- Copy the connection string:
Step 3: Connect Your Git Repository
Now let’s connect your application repository.- Public Repository
- Private Repository
- SSH Key
Get repository URL
Create application
- Click the Applications tab
- Click Create Application
- Enter:
Step 4: Configure Build Settings
Configure how Dokploy should build your application.Select build method
- Nixpacks (Auto-detect)
- Dockerfile
- Buildpacks
- Node.js (package.json)
- Python (requirements.txt, Pipfile)
- Go (go.mod)
- Ruby (Gemfile)
- PHP (composer.json)
- Rust (Cargo.toml)
Configure build settings
Set application port
Step 5: Configure Environment Variables
Add environment variables needed by your application.Add database connection
Add application-specific variables
Use secret management (optional)
- Mark variables as Secret by clicking the lock icon
- Secret values are encrypted and hidden in the UI
- They’re only available to the running application
Step 6: Configure Domain and SSL
Set up a custom domain with automatic HTTPS.Point domain to server
Add domain in Dokploy
- Scroll to Domains
- Click Add Domain
- Enter your domain:
- Enable Generate SSL Certificate
- Click Add
Configure SSL/TLS
- Navigate to Settings > Server
- Enter your email for Let’s Encrypt notifications:
- Select certificate resolver: Let’s Encrypt
- Save changes
Verify HTTPS
- Wait 1-2 minutes for certificate issuance
- Visit
https://app.example.com - Verify the padlock icon in the browser
Step 7: Deploy the Application
Now we’re ready to deploy!Review configuration
- ✅ Repository URL and branch
- ✅ Build method selected
- ✅ Environment variables configured
- ✅ Port specified
- ✅ Domain added (if using)
Start deployment
- Click Create & Deploy (or Deploy if editing existing app)
- The deployment process begins
Monitor build progress
Verify deployment
- Check status shows Running with green indicator
- Visit your domain:
https://app.example.com - Or via IP:
http://your-server-ip:3000
Step 8: Set Up Automated Deployments
Enable automatic deployments on Git push.Enable auto-deploy
- Go to Settings > General
- Enable Auto Deploy
- Select trigger:
- On Push - Deploy on every push to the branch
- On Tag - Deploy only on new Git tags
- Manual - Require manual deployment trigger
- Save changes
Configure webhook (GitHub/GitLab)
- Go to your repository settings
- Click Webhooks > Add webhook
- Payload URL:
https://your-dokploy-domain/api/webhooks/[app-id] - Content type:
application/json - Select: Just the push event
- Click Add webhook
- Go to Settings > Webhooks
- URL:
https://your-dokploy-domain/api/webhooks/[app-id] - Trigger: Push events
- Add webhook
Test automatic deployment
Step 9: Configure Monitoring and Alerts
Set up monitoring and notifications.View application metrics
- Open your application in Dokploy
- Click Monitoring tab
- View real-time metrics:
- CPU usage
- Memory consumption
- Network I/O
- Request rates (if applicable)
Configure notifications
- Navigate to Settings > Notifications
- Click Add Integration
- Choose notification method:
- Slack
- Discord
- Email
- Telegram
Test notifications
- Click Test next to your notification integration
- Verify you receive the test message
- Adjust settings as needed
Common Deployment Issues
Build fails - Dependencies not found
Build fails - Dependencies not found
- Ensure your lock file is committed (package-lock.json, yarn.lock, etc.)
- Check Node.js version compatibility
- Clear cache and rebuild:
- Go to Settings > Advanced
- Click Clear Build Cache
- Redeploy
Application won't start - Port issues
Application won't start - Port issues
- Verify the port in settings matches your application:
- Check application logs for startup errors
- Ensure your start command is correct
Database connection fails
Database connection fails
- Use internal Docker hostname, not
localhost: - Verify database is running:
- Go to Databases tab
- Check database status is Running
- Check credentials match database configuration
SSL certificate not issued
SSL certificate not issued
- Verify DNS is correctly configured:
- Ensure ports 80 and 443 are open:
- Check Let’s Encrypt rate limits (5 certificates per domain per week)
- Wait 5-10 minutes after adding domain for initial certificate issuance
Out of memory errors
Out of memory errors
- Increase memory limit:
- Go to Settings > Resources
- Increase Memory to 1GB or higher
- Optimize your build:
- Use production builds:
NODE_ENV=production - Minimize dependencies in production
- Use production builds:
- Consider upgrading your server resources
Best Practices
Use Environment Variables
- Database URLs
- API keys
- Secret tokens
Enable Health Checks
Configure Resource Limits
- Memory: Based on actual usage + 20% buffer
- CPU: Start with 0.5, adjust as needed
Set Up Backups
- Daily backups minimum
- Keep 7-30 days of backups
- Test restoration regularly
Monitor Logs
- Review error logs weekly
- Set up alerts for critical errors
- Use structured logging
Use Staging Environment
- Production - Live application
- Staging - Testing before production
- Development - Active development
Next Steps
Your application is deployed! Now explore advanced features:Custom Domains
Database Backups
Docker Compose
Multi-Node Setup
CI/CD Integration
Monitoring
Summary
You’ve successfully:- ✅ Created a project and database
- ✅ Connected a Git repository
- ✅ Configured build settings
- ✅ Set up environment variables
- ✅ Deployed with custom domain and SSL
- ✅ Enabled automated deployments
- ✅ Configured monitoring and alerts