Introduction
A few months ago, I started collaborating with Revant to enhance our easy install script. The outcome turned out to be very good and now you can self-host any first-party Frappe app in just two-commands! You can check out the self-hosting section, in the GitHub READMEs, of our products for these commands.
But that is not what this article is about. We went a step further to make self-hosting easier. In this article, you will learn how to use Dokploy’s ERPNext/Frappe HR templates to host your Frappe sites like a pro!
What is Dokploy?
According to their GitHub description, Dokploy is an open source alternative to Vercel, Netlify and Heroku. In simpler terms, it helps you easily self-host your applications and databases. It gets installed on your own server (as we will see in the next section) and gives you an intuitive UI to deploy containerised applications.
Setting up Dokploy
Creating a VM
First up, we will need a server running linux based operating system, preferably Ubuntu 24.04. For this tutorial, I will use a virtual machine (VM) on Hetzner. Let’s start by creating a new VM from Hetzner’s console:
As you can see, I am going with an option that gives 4 shared vCPUs and 8GB of RAM (feel free to go with a cheaper, 4GB RAM variant if you don't need much compute).
Installing Dokploy
Once our VM is ready, SSH into it as root:
ssh root@<IP-ADDRESS>
And run the following command (from Dokploy documentation):
curl -sSL https://dokploy.com/install.sh | sh
This command takes care of everything: from installing docker to starting up Dokploy services. This will take a few minutes, but if everything goes right, you will see the below message containing the link to access Dokploy’s frontend:
Open it up in your browser and set up email and password. You will need these for subsequent logins:
Deploying Frappe HR
Alright, we are ready to deploy our first Frappe instance! Don’t worry though, we have already done some hard work for you. Open the projects page using the sidebar:
Projects act as a “folder” for grouping your services/apps. Now, click on the + Create Project
button, fill in the form and hit Create
:
Inside this project, now click + Create Service
button and choose Template:
This is the hard work I was talking about 😆. We have contributed two production-ready templates to Dokploy: ERPNext and Frappe HR! But you can use these to deploy any Frappe app as we will see in the next section. For now, I will go with Frappe HR template. You can click on the newly created service to view its details. Don’t deploy it yet though, first we will configure a domain for our site.
Adding A Custom Domain (with SSL!)
Dokploy automatically generates free traefik.me
domains for your services, but, these domains do not support HTTPS. We will use a custom domain for our site. Feel free to skip this section if you are just trying it out and want to use the auto-generated domain.
Step 1: Add DNS Records
At this point you can buy a domain or use an existing one. From your domain’s DNS settings, add an A
record that points to your server’s IP address. You can even use a sub-domain like I am doing in this example:
Step 2: Update Domain on Dokploy
Once the DNS records are configured, you can navigate to Domains tab of your service and click on the edit button next to the domain:
The only change that you have to make here is to change the Host
field to the custom domain we configured in the previous step. In my case: hr.jennysart.online
.
Also, toggle HTTPS and select Let's Encrypt
as the provider. Hit Update
.
Step 3: Update Site Name
Open up the Environment tab and update the site name to your domain host name, then hit Save
:
We are good to go!
Deploying Our Site
Now you can navigate back to the General tab and just hit deploy:
On confirmation, your deployment will begin and you will be navigated to the Deployments tab where you can monitor the progress:
First deploy will take some time since it has to pull all the required docker images to your server. But once it is completed, navigate to the Logs tab and select the container that has create-site
in its name:
Wait for the site creation to finish (Scheduler is disabled line to print). Now you can open up the Domains tab and click on the domain:
And voila, we have our site up and running. And that too on HTTPS! 🥳 🥳
You can now login as Administrator
. You can find the password in the Environment tab:
Deploying Apps like CRM, Builder, and more!
If you want to deploy an app other than ERPNext and Frappe HR, you can still use the templates. Just update the IMAGE_NAME
and INSTALL_APP_ARGS
environment variables BEFORE deployment:
For instance, you can change the IMAGE_NAME
to ghcr.io/frappe/lms
to deploy Frappe Learning or ghcr.io/frappe/crm
to deploy Frappe CRM. Then update the INSTALL_APP_ARGS
to match the app name. You will also have to update the VERSION
to point to a tag that exists for that image. You can find a list of images and their tags here.
Deploying Custom Apps
In order to deploy custom apps (or multiple apps) for which ready-made docker images are not available, you can follow this guide on the frappe_docker
repository to build your own images and push them to a container registry. Then you can supply the URL to your image as the IMAGE_NAME
environment variable like we discussed above.
Updating
If there is a newer version of an app available, we can just Deploy
again, for it to pull the latest images. Alternatively, if you want to use a specific tag (e.g. v15.10.10
), you can change the VERSION
environment variable to that tag and re-deploy.
Automatic Backups
Dokploy team has a CRON job feature in their roadmap so this part would become as easy as setting up a CRON job that runs the bench backup command on some schedule:
bench --site all backup --with-files
But in the meantime you can add these services that do it for you.
Offsite Backups to S3
Framework has built in support for storing (backing-up? 😆) backups on AWS S3 which you may want to configure for serious deployments. You can find more about it in the docs.
OR ...you can just use Frappe Cloud!
Disclaimer: No one asked me to sell FC here, my genuine thoughts 😃
As you can see, Dokploy makes it easier to self-host Frappe Apps, but still, you have to put in some effort for the following tasks:
- Deploy and manage custom app images (also think about when you want to continuously push new changes to a custom app of your and deploy it)
- Make service level changes to add additional custom domains
- Monitor for downtime and fix your deployment
- Database Access for BI tools etc.
All this requires technical knowledge and DevOps resources. It becomes worse when you want to manage 10s or 100s of instances. If you want all these to be effortless and managed for you, give Frappe Cloud a try. Here is a quick sneak peek at some Frappe Cloud features that will make your life a lot easier:
Custom Apps with GitHub integration, so adding apps and deploying updates is just a click away!
Automated and managed on-site and off-site backups
Advanced Developer tools like Log Browser and DB Analyser
Comprehensive Analytics to help you monitor the performance of your sites
And so much more.
Conclusion
You might have noticed that Dokploy has a lot of other templates, you can also deploy those along with your Frappe sites. For example, you can deploy n8n
to build workflow automations and connect it to your Frappe site using the ERPNext node. For the purpose of this tutorial, we deployed both Dokploy and services on the same server, but you can read this guide for a multi-server setup.
I hope you find this guide useful and would love to hear your success stories with the Frappeverse!
Special thanks to Revant for all the help, feedback, and all the materials he puts out there for the community!