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.This tutorial assumes you’ve completed the Installation and reviewed the Quickstart guide.
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
Your application code hosted on:
- GitHub
- GitLab
- Bitbucket
- Any Git-compatible service
Don’t have an app ready? Fork our example repository to follow along.
Step 1: Create a Project
Projects help organize related applications and databases.Step 2: Set Up the Database
Most applications need a database. Let’s create a PostgreSQL database first.Create database
From your project dashboard:
- Click the Databases tab
- Click Create Database
- Select PostgreSQL
Set resource limits
Configure resource constraints:
Start with conservative limits. You can adjust based on actual usage later.
Step 3: Connect Your Git Repository
Now let’s connect your application repository.- Public Repository
- Private Repository
- SSH Key
Step 4: Configure Build Settings
Configure how Dokploy should build your application.Select build method
Choose the appropriate build method:
- Nixpacks (Auto-detect)
- Dockerfile
- Buildpacks
Recommended for most applications. Nixpacks automatically detects:
- Node.js (package.json)
- Python (requirements.txt, Pipfile)
- Go (go.mod)
- Ruby (Gemfile)
- PHP (composer.json)
- Rust (Cargo.toml)
Step 5: Configure Environment Variables
Add environment variables needed by your application.Step 6: Configure Domain and SSL
Set up a custom domain with automatic HTTPS.Point domain to server
First, configure your DNS:Add an A record:Wait for DNS propagation (5-30 minutes).
Add domain in Dokploy
In your application settings:
- Scroll to Domains
- Click Add Domain
- Enter your domain:
- Enable Generate SSL Certificate
- Click Add
Configure SSL/TLS
Dokploy uses Traefik with Let’s Encrypt for automatic SSL:
- Navigate to Settings > Server
- Enter your email for Let’s Encrypt notifications:
- Select certificate resolver: Let’s Encrypt
- Save changes
SSL certificates are automatically issued, renewed, and managed. No manual intervention required.
Step 7: Deploy the Application
Now we’re ready to deploy!Review configuration
Double-check all settings:
- ✅ 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
Step 8: Set Up Automated Deployments
Enable automatic deployments on Git push.Enable auto-deploy
In your application settings:
- 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)
Set up a webhook for instant deployments:GitHub:
- 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
Find your webhook URL in Dokploy under Settings > Webhooks.
Step 9: Configure Monitoring and Alerts
Set up monitoring and notifications.View application metrics
Monitor your application:
- 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
Get alerted about deployment events:
- Navigate to Settings > Notifications
- Click Add Integration
- Choose notification method:
- Slack
- Discord
- Email
- Telegram
Common Deployment Issues
Build fails - Dependencies not found
Build fails - Dependencies not found
Symptoms: Build fails with “Module not found” or “Package not found”Solutions:
- 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
Symptoms: Container starts but immediately stops, or health check failsSolutions:
- 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
Symptoms: Application logs show “Connection refused” or “Cannot connect to database”Solutions:
- 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
Symptoms: HTTPS doesn’t work, or shows “Invalid certificate”Solutions:
- 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
Symptoms: Application crashes with “JavaScript heap out of memory” or similarSolutions:
- 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
Never hardcode configuration:
- Database URLs
- API keys
- Secret tokens
Enable Health Checks
Add a health check endpoint:
Configure Resource Limits
Set appropriate limits:
- Memory: Based on actual usage + 20% buffer
- CPU: Start with 0.5, adjust as needed
Set Up Backups
Enable automatic database backups:
- Daily backups minimum
- Keep 7-30 days of backups
- Test restoration regularly
Monitor Logs
Regularly check application logs:
- Review error logs weekly
- Set up alerts for critical errors
- Use structured logging
Use Staging Environment
Create separate projects:
- Production - Live application
- Staging - Testing before production
- Development - Active development
Next Steps
Your application is deployed! Now explore advanced features:Custom Domains
Add multiple domains and configure advanced routing
Database Backups
Set up automated backups to S3 or other storage
Docker Compose
Deploy multi-container applications
Multi-Node Setup
Scale across multiple servers
CI/CD Integration
Advanced Git integration and workflows
Monitoring
Deep dive into monitoring and observability
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
Need help? Join our Discord community or check the troubleshooting guide.