Self-Hosting a Modern Deployment Platform on VPS with Dokploy
Platforms like Vercel and Netlify offer incredible developer ergonomics: push your code to Git, and everything just works. But as projects grow or need dedicated databases and background workers, costs escalate rapidly and you quickly bump against platform limits. I wanted the same seamless workflow—Git push, automated builds, zero-config HTTPS—on my own VPS with predictable monthly hosting costs.
The answer is Dokploy: an open-source alternative to Heroku, Vercel, and Netlify running on top of Docker and Traefik. In this guide, I will walk through installing Dokploy on a VPS via SSH, connecting a GitHub repository, and deploying an application behind custom domains with automated SSL.
Prerequisites
Before getting started, make sure you have:
- A VPS with at least 2GB RAM and 30GB disk space. Docker builds consume noticeable CPU and memory; running on undersized hardware can cause out-of-memory kernel panics. Dokploy officially recommends Ubuntu (20.04 LTS or newer).
- Open ports
80,443, and3000. Ports80and443are used by Traefik for inbound HTTP/HTTPS traffic, while port3000serves the Dokploy dashboard. - A custom domain (recommended) pointed to your VPS public IP via DNS A records.
Installing Dokploy
Connect to your VPS via SSH:
ssh root@your-vps-ip
Run the official one-line installation script. If Docker is not already installed on the machine, the installer will set it up automatically:
curl -sSL https://dokploy.com/install.sh | sh
Once the script completes, open your browser and navigate to http://your-vps-ip:3000. You will be greeted by the initial setup wizard to create the admin account. Fill in your email and a strong password to access the Dokploy dashboard.
Ensure your VPS firewall allows incoming traffic on port
3000so the setup interface is accessible.
Creating Projects and Applications
In Dokploy, resources are grouped under Projects. Think of a project as a logical namespace containing applications, databases, and supporting services.
- Click Create Project and name it (e.g.,
web-app). - Inside the project, click Create Service and choose Application.
The Application service handles pulling code from your repository and packaging it into a running Docker container.
Connecting Your GitHub Repository
Inside the newly created application, navigate to the Provider tab and select GitHub. Dokploy integrates via the official GitHub App OAuth workflow:
- Select the repository you want to deploy.
- Choose the target branch (typically
mainorproduction).
Dokploy supports both public and private repositories, either via the GitHub App or custom SSH deployment keys.
Choosing the Build Type
Dokploy offers multiple build strategies depending on your tech stack:
- Nixpacks — Automatically detects your programming language, framework, and system dependencies without requiring a Dockerfile. The fastest way to get started.
- Dockerfile — Uses a custom
Dockerfilepresent in your repository for total control over the build steps. - Heroku Buildpacks — Backwards-compatible with classic Cloud Native / Heroku buildpacks.
For simple applications, Nixpacks is fantastic. However, keep in mind that compiling assets directly on the server consumes significant RAM and CPU. For high-volume production setups, building images in CI/CD (such as GitHub Actions) and pulling pre-built images into Dokploy is the recommended practice. For single-server or hobby projects, building directly on the VPS is perfectly fine.
Setting Environment Variables
Most modern applications require environment variables for secrets and runtime configuration. Open the Environment tab in your application and add your variables:
DATABASE_URL=postgres://user:pass@host:5432/dbname
NODE_ENV=production
SECRET_KEY=super-secret-production-key
These variables are securely injected into the container during both build time and runtime execution.
Triggering the Deployment
Click the Deploy button. Dokploy pulls the latest code from GitHub, triggers the build pipeline, and launches the container. You can monitor the real-time build logs under the Deployments tab, making debugging straightforward if any dependency fails to resolve.
Configuring Custom Domains and HTTPS
Once the container is healthy, expose it to the internet. Navigate to the Domains tab and click Create Domain:
- Specify your domain hostname, e.g.,
app.yourdomain.com. - Set the internal container port (e.g.,
3000for a Next.js or Node app). - Enable HTTPS with automated Let's Encrypt certificates.
As long as your domain's DNS A record points to the VPS IP, Dokploy's bundled Traefik instance automatically provisions and renews TLS certificates without requiring manual Nginx or Certbot configuration.
Enabling Git Webhook Auto-Deployments
To achieve a true PaaS experience, head to the Deployments tab and enable auto-deployments via webhooks. Dokploy provides a webhook URL that you register in your GitHub repository settings.
From that point on, every git push to your target branch automatically triggers a webhook callback, initiating a zero-downtime deployment in Dokploy.
Summary
Dokploy delivers the convenience of modern cloud PaaS solutions—Git-triggered deployments, automated Let's Encrypt certificates via Traefik, and centralized environment management—all on your own infrastructure with zero vendor lock-in.
Beyond stateless applications, Dokploy can also provision databases (PostgreSQL, MySQL, MongoDB, Redis), run Docker Compose stacks, and schedule automated backups to S3-compatible object storage. If you want to dive deeper, check out the Dokploy Documentation.