Dokploy is a powerful, self-hosted Platform-as-a-Service (PaaS) solution that simplifies application deployment and management. Think of it as your own Vercel or Netlify that you control completely. In this comprehensive guide, we’ll walk through setting up Dokploy on a Ramnode Ubuntu 24 VPS and deploying your first application.

Why Dokploy + Ramnode?

Dokploy offers:

  • Simple application deployment with Git integration
  • Built-in database management (PostgreSQL, MySQL, MongoDB, Redis)
  • SSL certificate automation with Let’s Encrypt
  • Docker-based containerization
  • Intuitive web interface
  • Cost-effective self-hosting

Ramnode provides:

  • High-performance SSD and NVMe VPS hosting
  • Competitive pricing
  • Multiple data center locations
  • Reliable uptime and support

Prerequisites

Before we begin, ensure you have:

  • A Ramnode VPS running Ubuntu 24.04 LTS
  • Root or sudo access to your server
  • A domain name (optional but recommended)
  • Basic familiarity with command line operations

Recommended VPS Specifications

For a basic setup:

  • Minimum: 1 GB RAM, 1 CPU core, 20 GB SSD
  • Recommended: 2 GB RAM, 2 CPU cores, 40 GB SSD

Initial Server Setup

First, let’s prepare our Ubuntu 24 server with essential updates and security configurations.

Update the System

sudo apt update && sudo apt upgrade -y

Create a Non-Root User (Recommended)

# Create a new user
sudo adduser dokploy

# Add user to sudo group
sudo usermod -aG sudo dokploy

# Switch to the new user
su - dokploy

Configure Firewall

# Enable UFW firewall
sudo ufw enable

# Allow SSH (port 22)
sudo ufw allow ssh

# Allow HTTP and HTTPS
sudo ufw allow 80
sudo ufw allow 443

# Allow Dokploy's default port
sudo ufw allow 3000

# Check firewall status
sudo ufw status

Install Docker

Dokploy requires Docker to manage containerized applications. Let’s install Docker Engine:

# Install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Add Docker repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Update package index
sudo apt update

# Install Docker Engine
sudo apt install docker-ce docker-ce-cli containerd.io -y

# Add your user to docker group
sudo usermod -aG docker $USER

# Start and enable Docker service
sudo systemctl start docker
sudo systemctl enable docker

Important: Log out and back in for group changes to take effect, or run:

newgrp docker

Verify Docker installation:

docker --version
docker run hello-world

Install Docker Compose

Dokploy also requires Docker Compose:

# Install Docker Compose
sudo apt install docker-compose-plugin -y

# Verify installation
docker compose version

Install Dokploy

Now for the main event – installing Dokploy itself.

Method 1: One-Line Installation (Recommended)

Dokploy provides a convenient installation script:

curl -sSL https://dokploy.com/install.sh | sh

This script will:

  • Download and install Dokploy
  • Set up the necessary Docker containers
  • Configure basic settings
  • Start the Dokploy service

Method 2: Manual Installation

If you prefer more control over the installation process:

# Create dokploy directory
mkdir -p ~/dokploy && cd ~/dokploy

# Download docker-compose.yml
curl -sSL https://raw.githubusercontent.com/Dokploy/dokploy/main/docker-compose.yml -o docker-compose.yml

# Start Dokploy services
docker compose up -d

Verify Installation

Check that Dokploy containers are running:

docker ps

You should see containers for:

  • dokploy-dokploy-1 (main application)
  • dokploy-postgres-1 (database)
  • dokploy-redis-1 (cache)

Initial Dokploy Configuration

Access Dokploy Web Interface

  1. Open your web browser
  2. Navigate to http://your-server-ip:3000
  3. You should see the Dokploy setup wizard

Complete Setup Wizard

  1. Create Admin Account: Set up your administrator credentials
  2. Configure Domain (Optional): Add your domain name for better SSL management
  3. Database Setup: Dokploy will automatically configure its internal database
  4. SSL Configuration: Enable Let’s Encrypt for automatic SSL certificates

Configure Domain (Optional but Recommended)

If you have a domain name:

  1. Point your domain’s A record to your server’s IP address
  2. In Dokploy settings, add your domain
  3. Enable SSL certificate generation

Deploy Your First Application

Let’s deploy a simple Node.js application to test our setup.

From GitHub Repository

  1. Navigate to Applications in the Dokploy dashboard
  2. Click “Create Application”
  3. Configure Application:
    • Name: my-first-app
    • Source: GitHub repository
    • Repository URL: https://github.com/vercel/next.js/tree/canary/examples/hello-world
    • Branch: main
  4. Environment Configuration:
    • Build Command: npm run build
    • Start Command: npm start
    • Port: 3000
  5. Deploy: Click “Deploy” and watch the magic happen!

Custom Domain Setup

After successful deployment:

  1. Go to your application settings
  2. Add your custom domain
  3. Enable SSL certificate generation
  4. Update your DNS records to point to your server

Database Management

Dokploy makes database management incredibly simple.

Creating a Database

  1. Navigate to Databases in the dashboard
  2. Click “Create Database”
  3. Choose your database type:
    • PostgreSQL
    • MySQL
    • MongoDB
    • Redis
  4. Configure database settings:
    • Database name
    • Username and password
    • Memory allocation

Connecting Applications to Databases

Dokploy automatically provides connection strings that you can use in your applications:

// Example for Node.js with PostgreSQL
const connectionString = process.env.DATABASE_URL;

Advanced Configuration

Custom Docker Images

For applications requiring custom environments:

# Example Dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

Environment Variables

Manage environment variables through the Dokploy interface:

  • Go to your application settings
  • Navigate to “Environment Variables”
  • Add key-value pairs as needed

Monitoring and Logs

Access application logs and metrics:

  • Logs: View real-time application logs in the dashboard
  • Metrics: Monitor CPU, memory, and network usage
  • Health Checks: Configure automatic health monitoring

Backup and Maintenance

Database Backups

Set up automatic database backups:

# Example backup script
#!/bin/bash
docker exec dokploy-postgres-1 pg_dump -U dokploy dokploy > backup-$(date +%Y%m%d).sql

System Updates

Keep your system updated:

# Update system packages
sudo apt update && sudo apt upgrade -y

# Update Docker images
docker compose pull
docker compose up -d

Dokploy Updates

Update Dokploy when new versions are released:

curl -sSL https://dokploy.com/install.sh | sh

Troubleshooting Common Issues

Port 3000 Already in Use

If port 3000 is occupied:

# Check what's using the port
sudo lsof -i :3000

# Kill the process if necessary
sudo kill -9 <PID>

Docker Permission Issues

If you encounter permission errors:

sudo usermod -aG docker $USER
newgrp docker

SSL Certificate Issues

For SSL certificate problems:

  1. Ensure your domain points to the correct IP
  2. Check that ports 80 and 443 are open
  3. Verify DNS propagation using dig yourdomain.com

Database Connection Issues

If applications can’t connect to databases:

  1. Check database status in the Dokploy dashboard
  2. Verify connection strings
  3. Ensure proper environment variable configuration

Security Best Practices

Server Hardening

# Disable root login
sudo nano /etc/ssh/sshd_config
# Set: PermitRootLogin no

# Restart SSH service
sudo systemctl restart ssh

# Install fail2ban for intrusion prevention
sudo apt install fail2ban -y

Dokploy Security

  1. Use Strong Passwords: Ensure admin accounts have strong passwords
  2. Regular Updates: Keep Dokploy and system packages updated
  3. SSL Certificates: Always use HTTPS for production applications
  4. Database Security: Use strong database passwords and restrict access

Performance Optimization

Server Optimization

# Optimize Docker for production
echo '{"log-driver": "json-file", "log-opts": {"max-size": "10m", "max-file": "3"}}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker

Application Optimization

  1. Resource Limits: Set appropriate CPU and memory limits
  2. Caching: Utilize Redis for application caching
  3. CDN: Consider using a CDN for static assets
  4. Database Optimization: Optimize database queries and use indexing

Conclusion

You now have a fully functional Dokploy installation on your Ramnode Ubuntu 24 VPS! This self-hosted PaaS solution provides enterprise-grade deployment capabilities without the recurring costs of managed services.

Key Takeaways

  • Cost-Effective: Self-hosting saves money compared to managed PaaS solutions
  • Full Control: Complete control over your deployment environment
  • Scalable: Easy to scale applications and databases as needed
  • Secure: Built-in SSL management and security features

Next Steps

Consider exploring:

  • Multi-application deployments for complex projects
  • Custom CI/CD pipelines for automated deployments
  • Load balancing for high-traffic applications
  • Database clustering for improved performance

Resources

Happy deploying! With Dokploy on Ramnode, you have a powerful, cost-effective platform for all your application deployment needs.