Deploy Any App with Dokploy
Table of Contents
- Introduction
- Prerequisites
- Deploying React App on Dokploy
- Deploying Next.js App on Dokploy
- Deploying NestJS App on Dokploy
- Deploying Svelte(SvelteKit) on Dokploy
- Deploying the Deno App on Dokploy
- Deploying Remix App on Dokploy
- Monitoring and Maintenance
- Troubleshooting Common Issues
- Conclusion
dokploy.com
Introduction
Overview of Dokploy:
Dokploy is a self-hostable, open-source, modern Platform-as-a-Service (PaaS) that simplifies the deployment and management of applications. It is an open-source alternative to platforms like Vercel, Heroku, and Netlify.
Purpose of the Tutorial
This tutorial aims to guide you through deploying nine different application types using Dokploy — including both frontend and backend frameworks.
Let’s get started!
Prerequisites
Before deploying the applications make sure that both your development and server environments are properly set. Here is what you will need. The requirements of course change depending on which app you are deploying.
🛠️ Development Environment
To follow this tutorial and deploy all supported application types, ensure your local development includes the following:
- Node.js and npm: Required for most JavaScript-based frameworks, such as Next.js, React, NestJS, Vue, Svelte, Remix, and Astro.
You can verify the installation with:
node -v
npm -v
Deno: Required if you are deploying Deno applications. Verify installation with:
deno --version
Framework CLIs(Optional)
- React: npx create-react-app
- Next.js: npx create-next-app
- NestJS: npm i -g @nestjs/cli
- Remix: npx create-remix
- SvelteKit: npm create svelte@latest
- Vue: npm create vue@latest
- Astro: npm create astro@latest
⚙️ Dokploy Setup
You will need a server with Dokploy installed and running. Once set up, you can begin deploying your applications.
🔁 Version Control with Git
Dokploy integrates directly with Git repositories for deployments. Your application should meet the following requirements:
- Be tracked with Git
- Have a remote origin (e.g., GitHub, GitLab, Bitbucket)
- Be committed and pushed to a branch
Deploying React App on Dokploy
🛠️ 1. Create a New Project in Dokploy
Log In
Open your Dokploy dashboard: http://your_server_ip:3000
- Log in with your credentials.
Create Project
- Click “Create Project”.
Enter your project name (e.g., React App).
- Click “Create”.
⚙️ 2. Add Your React Application
Create Service
- Inside your project, click “Create Service”.
- Select “Application” as the service type.
Name the service (e.g., react-app).
- Click “Create”.
Configure Git Repository
- Go to the "Git Provider" section of the service.
- Enter your Git repository URL.
Set the deployment branch (e.g., main).
⚒️ 3. Define Build & Publish Settings
Build Command
- Set the build command to:
npm run build
Publish Directory
- Set the publish directory to:
./build
🚀 4. Manual Deployment
- Go to the “Deployments” tab.
- Click “Deploy” to start the process.
- Dokploy will:
- Clone the repo,
- Run the build command,
- Serve your static React files.
🌐 5. Access Your Deployed App
Dokploy provides a default domain (e.g.,http://your_server_ip:3000).
- Use this to view your deployed React app.
🌍 6. Configure Custom Domain (Optional)
Generate Domain
- In the “Deployments” tab, click “Generate Domain” to get a public domain.
Update DNS Settings
- In your DNS provider:
- Add an A record pointing to your Dokploy server’s IP.
Access Your App
- After DNS propagation, your app will be live on your custom domain.
🔐 7. Set Up SSL Certificate (Optional)
Enable SSL
- Dokploy automatically generates a free SSL cert with Let’s Encrypt.
- Turn on SSL in the app settings.
Verify SSL
- Open your app in the browser using:
arduino
CopyEdit
https://your_domain
📈 8. Monitor and Manage Your App
- Logs: Use the real-time logging view to debug or inspect deployments.
- Scaling: Adjust resources like CPU or memory directly from the Dokploy UI.
Deploying Next.js App on Dokploy
🛠️ 1. Create a New Project in Dokploy
Log In
Open your Dokploy dashboard: http://your_server_ip:3000
Log in with your credentials.
Create Project
- Click “Create Project”.
Enter your project name (e.g., Next.js App).
- Click “Create”.
⚙️ 2. Add Your Next.js Application
Create Service
- Inside your project, click “Create Service”.
- Select “Application” as the service type.
Name the service (e.g., nextjs-app).
- Click “Create”.
Configure Git Repository
- Go to the "Git Provider" section of the service.
- Enter your Git repository URL.
Set the deployment branch (e.g., main).
🚀 3. Manual Deployment
- Navigate to the “Deployments” tab of your application.
- Click “Deploy”.
- Dokploy will:
- Pull your latest code,
- Run the build process,
- Deploy your Next.js app.
🌐 4. Access Your Deployed App
After deployment, Dokploy provides a default domain (e.g., http://your_server_ip:3000).
- Visit that URL to access your live Next.js app.
🌍 5. Configure Custom Domain (Optional)
Generate Domain
- In the “Deployments” tab, click “Generate Domain” to assign a public domain to your app.
Update DNS Settings
- In your domain registrar:
- Add an A record pointing to your server’s IP.
Access Your App
- After DNS propagation, visit your custom domain to access your app.
🔐 6. Set Up SSL Certificate (Optional)
Enable SSL
- Dokploy auto-generates a free SSL certificate using Let’s Encrypt.
- Enable SSL in your app’s settings.
Verify SSL
Access your app at: https://your_domain
Confirm the SSL certificate is active.
📈 7. Monitor and Manage Your App
- Logs: View live logs for deployment and runtime debugging.
- Scaling: Adjust resources (CPU/RAM) as needed to scale your app via the Dokploy UI.
Deploying NestJS App on Dokploy
🛠️ 1. Create a New Project in Dokploy
Log In
Open your Dokploy dashboard: http://your_server_ip:3000
- Log in with your credentials.
Create Project
- Click “Create Project”.
Enter your project name (e.g., NestJS API).
- Click “Create”.
⚙️ 2. Add Your NestJS Application
Create Service
- Inside the project, click “Create Service”.
- Choose “Application”.
Set the service name (e.g., nestjs-api).
- Click “Create”.
Configure Git Repository
- Under the "Git Provider" section:
- Enter your Git repo URL.
Set the branch to deploy (e.g., main).
⚒️ 3. Define Build & Run Settings
Build Command
If your project uses TypeScript (which is the default for NestJS), set the build command:
npm run build
Start Command
After building, NestJS apps are typically started with:
npm run start:prod
Ensure your package.json includes:
"scripts": {
"build": "tsc",
"start:prod": "node dist/main"
}
🔁 4. Environment Variables (Optional)
In the “Environment Variables” section of the service, add any .env values needed by your NestJS app (e.g., DATABASE_URL, JWT_SECRET, etc.).
🚀 5. Manual Deployment
- Head to the “Deployments” tab.
- Click “Deploy”.
- Dokploy will:
- Clone your code,
- Run the build script,
- Start your NestJS server on the assigned port.
🌐 6. Access Your Deployed API
After deployment, Dokploy assigns a domain (e.g., http://your_server_ip:3000).
- Your NestJS API will be accessible via that domain:
GET http://your_server_ip:3000/api/hello
🌍 7. Configure Custom Domain (Optional)
Generate Domain
- In the “Deployments” tab, click “Generate Domain”.
Update DNS
- Add an A record in your domain provider, pointing to your server IP.
🔐 8. Set Up SSL Certificate (Optional)
Enable SSL
- Dokploy provisions a free SSL certificate via Let’s Encrypt.
Verify
- Access your backend securely:
https://your_domain/api/hello
📈 9. Monitor and Manage Your API
- Logs: Tail logs in real-time to debug your NestJS app.
- Scaling: Adjust server resources as needed via Dokploy UI.
Deploying Svelte(SvelteKit) on Dokploy
Same deployment flow as above.
Adapter: Use @sveltejs/adapter-node for SSR support:
import adapter from '@sveltejs/adapter-node';
export default {
kit: {
adapter: adapter()
}
};
- Build Command:
npm run build
- Start Command:
npm run preview
You may also use node build if exporting a node server manually.
Environment: If you’re using .env files (e.g., VITE_API_URL), configure them in the Dokploy UI.
Deploying the Deno App on Dokploy
Deno apps are also supported via the same steps.
- No Build Step Required
- Start Command Example:
deno run --allow-net mod.ts
Replace mod.ts with your entry file.
Permissions: Grant any required permissions using flags (--allow-env, --allow-read, etc.).
Deno Deploy Tip: If you're using Fresh (a popular Deno framework), serve using:
deno task start
With a deno.json like:
{
"tasks": {
"start": "deno run -A main.ts"
}
}
Deploying Remix App on Dokploy
Follows the same setup process as above (see Next.js or React). Below are Remix-specific configurations.
Build Command:
npm run build
Start Command:
npm run start
Required Package:
Use remix-serve or a custom server (e.g., Express).
Your package.json should include:
"scripts": {
"build": "remix build",
"start": "remix-serve build"
}
Port Note: Ensure Remix uses the port provided by Dokploy (typically via process.env.PORT).
Monitoring and Maintenance
Monitoring is the continuous process of observing and tracking an application's performance, availability, and resource usage.
Maintenance refers to the ongoing tasks required to keep an application stable, secure, and up to date.
These are critical steps that follow deployment. They include:
- Log Management: Use Dokploy's built-in logging features to monitor application performance, track errors, and gain visibility into system health in real time.
- Regular Backups: Automate backups for applications and databases to ensure data recovery in case of failures.
Troubleshooting Common Issues
🚫 Deployment Failures
Identify and resolve common deployment errors such as misconfigured environments, missing environment variables, or build failures. Dokploy’s deployment logs and error messages can help pinpoint the root cause quickly.
🐢 Performance Bottlenecks
Optimize application performance post-deployment by monitoring response times, reducing database queries, and enabling caching where appropriate. Use Dokploy’s performance insights or integrate APM tools for deeper analysis.
🔐 Security Concerns
Ensure deployed applications are secure by:
- Applying security updates regularly
- Using HTTPS and secure headers
- Scanning for vulnerabilities in dependencies
- Dokploy supports automated update workflows to keep your app up to date.
Conclusion
In this article, we have covered how to deploy different types of applications: React.js, Next.js, NestJS, Remix, Deno, and Svelte. We have also discussed the essential procedures to follow after deploying an application, such as monitoring and maintenance. With this knowledge, you can effectively deploy applications on Dokploy.
Happy Deployments!
Frequently Asked Questions
What is Dokploy?
Dokploy is a self-hostable, open-source platform-as-a-service (PaaS) that simplifies the deployment and management of applications. It provides a streamlined process for deploying various types of applications, including React.js, Next.js, NestJS, Remix, Deno, and Svelte, on your own infrastructure.
What frameworks are supported for deployment on Dokploy?
Dokploy supports the deployment of the following frameworks: React.js, Next.js, NestJS, Remix, Deno, Svelte, SvelteKit.
What are the prerequisites for deploying applications on Dokploy?
To deploy applications on Dokploy, you need: Node.js and npm (for JavaScript-based frameworks such as React.js, Next.js, NestJS, etc.), Deno (if deploying Deno applications), Git (for version control), and a server with Dokploy installed and running.
How do I set up a project on Dokploy?
To create a new project on Dokploy: 1. Log in to your Dokploy dashboard. 2. Click on 'Create Project'. 3. Enter the project name (e.g., 'React App'). 4. Click 'Create' to set up your project.
How do I connect my Git repository to Dokploy for deployment?
To connect your Git repository: 1. Go to the 'Git Provider' section in the service settings. 2. Enter the repository URL. 3. Specify the deployment branch (e.g., main). Dokploy will automatically pull your code and deploy it based on your configuration.
Can I use a custom domain with Dokploy?
Yes, Dokploy allows you to configure a custom domain: 1. In the 'Deployments' tab, click 'Generate Domain'. 2. Update your DNS settings with an A record pointing to your Dokploy server's IP. Once DNS propagation is complete, you can access your app using the custom domain.
Does Dokploy support SSL certificates?
Yes, Dokploy automatically provisions free SSL certificates via Let’s Encrypt. You can enable SSL for your applications within the Dokploy UI, ensuring secure access over HTTPS.
How can I monitor my deployed application on Dokploy?
Dokploy provides real-time logs for application monitoring, allowing you to track performance, view errors, and debug issues. You can also manage the scaling of your app directly from the Dokploy interface by adjusting resources like CPU and memory.
What if my deployment fails?
Common deployment issues can be identified by reviewing the deployment logs. Some common causes of failure include misconfigured environment variables, missing dependencies or incorrect build commands, and Git repository issues. Dokploy’s logs will help you pinpoint and resolve the problem quickly.
Can I deploy backend applications (e.g., NestJS, Deno) on Dokploy?
Yes, Dokploy supports both frontend and backend applications, including NestJS (for APIs) and Deno (for server-side applications). Simply follow the deployment steps as outlined for frontend applications, ensuring that your build and start commands are correctly set for backend services.
How do I set environment variables for my application on Dokploy?
You can add environment variables directly in the 'Environment Variables' section of your service's settings in the Dokploy UI. These are typically used for database connections, API keys, or other sensitive information.
How can I scale my application on Dokploy?
Dokploy allows you to scale your application by adjusting resources like CPU and memory in the application’s settings. This ensures your app can handle more traffic or demand as needed.
Is Dokploy suitable for production deployments?
Yes, Dokploy is designed for both development and production deployments. With its built-in monitoring, logging, and scaling features, it provides everything needed to manage production-grade applications effectively.
Can I deploy static sites with Dokploy?
Yes, Dokploy can also be used to deploy static sites built with frameworks like Next.js, React.js, and SvelteKit, or even static HTML/CSS sites. It serves your built files directly from the server, ensuring fast load times and easy management.
References
Background References
- (January 8, 2025). Welcome to Dokploy. *Dokploy*. Retrieved January 8, 2025 from https://docs.dokploy.com/docs/core
- (October 12, 2024). Platform as a service. *Wikipedia*. Retrieved October 12, 2024 from https://en.wikipedia.org/wiki/Platform_as_a_service
- (January 30, 2025). Monitoring. *Dokploy*. Retrieved January 30, 2025 from https://docs.dokploy.com/docs/core/monitoring
About the Author
Joseph Horace
Horace is a dedicated software developer with a deep passion for technology and problem-solving. With years of experience in developing robust and scalable applications, Horace specializes in building user-friendly solutions using cutting-edge technologies. His expertise spans across multiple areas of software development, with a focus on delivering high-quality code and seamless user experiences. Horace believes in continuous learning and enjoys sharing insights with the community through contributions and collaborations. When not coding, he enjoys exploring new technologies and staying updated on industry trends.