August 26th, 2024

Dokku: My favorite personal serverless platform

Dokku is an open-source PaaS enabling users to create a serverless platform on a VPS. It features automatic SSL, basic authentication, Docker deployment, and supports GitHub Actions for automatic deployments.

Read original articleLink Icon
EnthusiasmSkepticismConfusion
Dokku: My favorite personal serverless platform

Dokku is an open-source Platform as a Service (PaaS) that allows users to transform a virtual private server (VPS) into a serverless platform, similar to Heroku but with ownership and cost-effectiveness. The author, Hamel Husain, utilizes Dokku on a $7/month VPS from OVHcloud for various applications related to his consulting work in large language models (LLMs). Key features of Dokku include ease of use, automatic SSL management via Let’s Encrypt, basic authentication support, and the ability to scale applications with simple commands. Users can deploy applications using Docker containers by creating a Dockerfile and pushing code via Git. Additionally, Dokku supports the deployment of static sites from private GitHub repositories, allowing for password protection and easy configuration. The platform also facilitates automatic deployments through GitHub Actions, streamlining the deployment process. The author shares various tips for managing applications on Dokku, such as running commands remotely and managing Docker cache. Overall, Dokku provides a flexible and cost-effective solution for developers looking to deploy applications without the high costs associated with traditional PaaS providers.

- Dokku is an open-source PaaS that allows users to own their serverless platform.

- It offers features like automatic SSL management, basic authentication, and easy scaling.

- Users can deploy applications using Docker containers and Git commands.

- Dokku supports static site deployment from private GitHub repositories.

- Automatic deployments can be configured using GitHub Actions for convenience.

AI: What people are saying
The comments on Dokku highlight various user experiences and opinions regarding the platform.
  • Many users appreciate Dokku for its simplicity and effectiveness in deploying applications, often comparing it favorably to other PaaS solutions.
  • There is confusion and debate over the term "serverless," with several commenters questioning how a platform that requires a server can be classified as such.
  • Users express a desire for better configuration management, with some noting the lack of declarative configuration options.
  • Several commenters share their experiences with alternatives to Dokku, such as Coolify and Kubernetes, discussing their pros and cons.
  • Overall, there is a strong sense of community support for Dokku, with many users willing to contribute financially or through development.
Link Icon 63 comments
By @benbristow - 4 months
I've been enjoying using Dokploy recently.

https://github.com/Dokploy/dokploy

It's similar to Dokku but has a nice web UI, makes it easier to deploy Docker/Compose solutions and auto LetsEncrypt functionality is built-in by design (not as a separate plugin).

I've also built a GitHub Actions workflow to trigger off a deploy to apps hosted on it (basic cURL command but works well). https://github.com/benbristow/dokploy-deploy-action

And put together some pre-configured Compose files you can deploy for various apps. https://github.com/benbristow/dokploy-compose-templates

By @dewey - 4 months
I was looking at many of these "selfhosted Heroku" type of solutions recently and read many HN discussions about the different options (coolify.io, ploi, ...) as I migrated to a new server and always copying, adapting nginx configs got a bit old.

I've landed on Dokku in the end as it's the one with the least amount of "magic" involved and even if I stopped using it I could just uninstall it and have everything still running. Can highly recommend it!

The developer is also super responsive and I even managed to build a custom plugin without knowing too much about it with some assistance. Documented this on my blog too: https://blog.notmyhostna.me/posts/deploying-docker-images-wi...

By @interstice - 4 months
I have found over the years that trying new software risks immediately running into a road block in real use. There will be some detail or complexity or bug on a semi-basic requirement that goes directly to an issue in github.

Dokku is not one of those, it does what it does well and aside from a couple of cli argument ordering quirks it's been great for my light usage. If I was using it more I'd probably want to configure entire architectures with declarative config files, I have no idea if it can do that though.

By @notpushkin - 4 months
Dokku is really neat! I've been using it before moving to building my own Docker images and deploying with Swarm. It was also (partly) the motivation behind my own take on self-hosted PaaS, Lunni (shameless plug): https://lunni.dev/

In general, I really love the idea of running all your stuff on a server you own as opposed to e.g. Heroku or AWS. Simple predictable monthly bill really gives you peace of mind.

By @password4321 - 4 months
Related discussion on the front page today: "Coolify’s rise to fame, and why it could be a big deal" https://news.ycombinator.com/item?id=41356239

> Coolify can enable organizations of any size to host an arbitrary number of free, self-hosted software easier than ever.

https://github.com/coollabsio/coolify

> An open-source & self-hostable Heroku / Netlify / Vercel alternative.

By @HL33tibCe7 - 4 months
> It’s often desirable to have HTTPS for your site. Dokku makes this easy with the Let’s Encrypt Plugin, which will even auto-renew for you. I don’t use this, because I’m letting Cloudflare handle this with its proxy.

Hopefully you do use TLS between Cloudflare and your Dokku (even with a self-signed cert or something), otherwise your personal sites (which are apparently sensitive enough to put behind basic auth) are being transited over the internet in plaintext.

By @Mackser - 4 months
I've been using Dokku for many years. It's remarkably stable and easy to use. I wrote an extensive tutorial on how to deploy various apps and websites with Dokku in 2018 [1] and I'm sure that following the same steps still works 6 years later.

1: https://maxschmitt.me/posts/tutorial-deploy-apps-websites-do...

By @realty_geek - 4 months
Delighted to see dokku on here. It's an amazing product and the founder is super humble and helpful. I can't afford to throw much money at it now but it would be great if more people supported it financially
By @conradludgate - 4 months
My experience with dokku was pretty poor. It was quick to start with but on my VPS crashing and restarting, my apps would not relaunch. I'd have to re-run the dokku commands again. Perhaps I did something wrong but I inevitably switched to a single-node k8s setup as it ended up being more reliable
By @aledalgrande - 4 months
Curious: for this type of infra, what do people use for file/object storage? Using something like AWS would negate all the savings with egress costs.
By @mdasen - 4 months
Dokku is great, but historically it didn't really handle resilience. It looks like there's now a K3s scheduler (added earlier this year) which would mean I could have use a Kubernetes operator for a replicated database as well as have the app running on multiple boxes (in case one fails). It looks like it'll even setup K3s for you. The docs don't seem to go into it, but hopefully the ingress can also be setup on multiple boxes (I wonder if it uses a NodePort or the host network).

I was sad when Flynn died (https://github.com/flynn/flynn), but it's great to see Dokku doing well.

By @oezi - 4 months
My major gripe with dokku is that there is no way to define the configuration in a file rather than executing the commands manually.

Otherwise: totally agree, great tool for self hosting.

By @andrewmutz - 4 months
I've been using a different tool that provides great developer UX for managing containerized web apps on your own servers. Its dead simple and does things like zero-downtime deploys and remote builds.

https://kamal-deploy.org/

I use it with rails but it works with any containerized web apps.

By @paxys - 4 months
Looks neat, but what exactly makes it "serverless"? It's literally an application that you have to run on your server.

Edit: turns out (thankfully) that it's only the author of the article using that term. The project site (https://dokku.com/) is very descriptive.

By @throwaway77385 - 4 months
One more upvote for Dokku. Been using it for as long as I can remember hosting things on servers. It is such an incredible piece of software. And open source to boot. If any of my projects ever make money, Dokku will be the first project I'm funding.
By @mike31fr - 4 months
How does it compare to Coolify? https://coolify.io
By @bjornsing - 4 months
Why does the title say “serverless” though? AFAIK Dokku is very much a “server platform”.
By @gslepak - 4 months
Can someone explain what this is for someone who doesn't know what Heroku is, and why it's called serverless when it clearly requires a server?
By @fpauser - 4 months
Or simply use traefik + app containers via standard podman + systemd integration:

https://docs.podman.io/en/latest/markdown/podman-systemd.uni...

https://traefik.io/traefik/

By @Pxtl - 4 months
I'm going to confess something: I still do it oldschool. A single box with a SQL server and a webserver running on it. I've taken courses in Docker and whatnot but never applied them.

When you're hosting a single-node cluster, what value do these docker-based tools offer? Is it the fact that you can use a dockerfile to declare your OS-level dependencies consistently?

By @shepherdjerred - 4 months
Is there any advantage of Dokku over using Kubernetes (I already have a person single-node cluster).

I initially setup Dokku on K8s, but since it would just deploy to that same server it makes more sense IMO to just use K8s

By @hmaxdml - 4 months
I liked Dokku when I was still happy using docker, but since I started working on https://www.dbos.dev/, I value microVMs way more.

The problem with Dokku is that, while its easy to use if you have experience in devops, well.. you still need to know devops! That's not what I call serverless...

By @progforlyfe - 4 months
Dokku looks great, I have not tried it yet myself. I've been using CapRover (similar thing) for years and have no complaints! LetsEncrypt support built in, has a web interface and CLI utility to deploy (can also use github triggers).
By @byrnedo - 4 months
Striking while the iron is hot: I love dokku and I've used it for many years. That said, I thought I'd do something similar but with the goal of supporting k8s manifests

https://github.com/skateco/skate

It's daemonless, multi-host with multi-host networking, service discovery and like I said, allows you to create deployments, cronjobs, and route traffic via ingress resources.

Comes with letsencrypt out of the box.

By @wirelesspotat - 4 months
Does anyone have experience using dokku-postgres?

The GitHub readme is well documented but hard to know how that translates into the dev exp, like with scaling or upgrades and if its features are comparable to managed Postgres providers (I'd assume no but happy to be proven wrong!)

[0] https://github.com/dokku/dokku-postgres

By @gvkhna - 4 months
Is anyone running truenas scale for this kind of purpose. I haven’t used it but its architecture around k8s seems extremely promising. For most use cases a simple docker container is all you need but sometimes running other apps like grafana with a k8 manifest is easier to manage in one vps and gives you the flexibility of a cluster. Just curious.
By @pelagicAustral - 4 months
IMHO Dokku still outperforms all other open-source alternatives for deploying Rails apps. There are a few proprietary alternatives that still manage the job with far more simplicity, but those are paid... I have tried to deploy with Kamal, DHHs Junta preferred way, but is still not better than Dokku in it's management and simplicity, and top of that, if follows the framework's latest trend of poor-to-no documentation.
By @est - 4 months
I am wondering why php wasn't more popular? Think php as a serverless platform:

1. 10 minute to learn, simple syntax, rich functions

2. deploy with standard tools like ftp

3. easy scaling with php-fpm.

4. not exactly docker, but vhost works in most cases. And vhost can be containerized.

5. insta hot-reload

6. dirt cheap cost. Hi dreamhost

7. no vendor lock-in bullshit, supported by everyone everywhere

well, at least it was the case used to be

By @calyhre - 4 months
I really like Dokku. I recently wrote a plugin to automatically expose the apps I add on it on my local network as subdomains of the host via MDNS (https://github.com/calyhre/dokku-mdns), perfect for hobbyists
By @windowshopping - 4 months
I have a heroku app that I'd love to try migrating. It's a pretty simple express.js single page app running on heroku's lowest level, uses firebase and has no database or other backend dependencies. The domain is on godaddy and it uses Cloudflare for DNS. Heroku's "Automated Certificate Management" takes care of the SSL cert.

The main issue is that it's for playing a game, and the game is held in-memory, and once a day heroku restarts their servers, so everyone gets kicked out of the game they're in when it restarts with cleared process memory. I need to fix this by migrating and I don't have time.

If anyone feels like this migration would be something that they have relevant experience for and which they could do confidently, please get in touch. Email in profile.

By @simplecto - 4 months
Great writeup -- I have a gist floating around somewhere with a similar workflow, but for bitbucket pipelines.

Good solve!

By @LAC-Tech - 4 months
I'm outing myself as a bit ignorant here, but the author:

- used a VPS - made a docker file

So what does doku actually do?

By @daitangio - 4 months
If you search a simpler solution I suggest

https://github.com/daitangio/misterio

I created it for managing my homelab, it works great and it is a thin layer over docker compose

By @cynicalsecurity - 4 months
Self-hosted solutions are the way.

No one will be stealing your data as the big corps do.

Less chances to overrun your budget because of how cloud platforms conveniently have no breaks on utilisation of resources.

By @slig - 4 months
Any suggestion for a simple FaaS platform that isn't OpenFaaS? Fn Project looked promising, but their repo looks abandoned (more than one year without commits).
By @ravxx - 4 months
just get good with docker and make a shell script to instantly create/update pre-existing docker images. you wont regret it.
By @progrium - 4 months
Damn, who wrote this amazing piece of software
By @wtcactus - 4 months
I do have a hard time understanding how is this different from setting up a VM with docker running on it.

I don't see any added benefits in therms of the extent of configuration I need to deploy. What is the new thing Dokku and other similar services bring to the table? What is the extra configuration I don't have to do if I go with it?

By @ThinkBeat - 4 months
Looking at the examples in the post above, and looking at the Dokku site and documentation

Is it the case that there is no visual in the free version? Just hacking around some files? That is not that user friendly and certainly does not really remind me of Heroku.

The GUI you get with the Pro version looks good. and only a bit more than $800 for life.

By @xrd - 4 months
I love dokku. And josegonzalez is always a huge help.

I pay a monthly support to dokku. You should too. Jose will help you either way, but I feel slightly less guilty when I ask questions and he immediately resolves them for me in the slack channel. Don't you want to use this incredible piece of software guilt free?

By @mentalgear - 4 months
Has anyone a made or has a link to a recent, detailed comparison between all these self-host-platform projects?
By @pollux01 - 4 months
I have a video on how to setup Dokku via Docker, so you can launch it in any server like aws or digital ocean without paying extra for other services.

https://youtu.be/O_-KxC9FjuA

By @marko-djuric - 4 months
Last time i tried to use Dokku as Docker container it was unusable, Nginx, Traefik, Mongo, https all plugins with bugs, 2 weeks wasted on debugging without result.
By @hedgehog - 4 months
Are there plugins or anything that will allow Dokku to run queues of batch jobs? Skimming the docs there is clear support for Heroku-style apps and one-offs that can be launched via cron, not so much for batch although it would be quite useful.
By @chasd00 - 4 months
A linode vm + dokku has supported my personal projects (for profit and otherwise) for years.
By @trallnag - 4 months
For personal stuff I always come back to Ansible and, if I want it containerized, Kubernetes
By @b_shulha - 4 months
Dokku is great, but have you tried https://ptah.sh ? ;)

(sorry)

This is the service I have been working for the lasts months alongside my 9-5. Heavily inspired by Coolify, but it is based solely on Docker Swarm to save the development efforts on other features.

Also, it is a bit opinionated to adjust the UX to what I need myself, so there are slight deviations from the way how others work with Swarm.

I have a short vid which I have recorded today on how one could easily deploy WordPress to any VPS: https://youtu.be/k34Zdwcsm6I

It covers usage of the 1-Click apps templates which speed up everything "a little bit".

By @dangus - 4 months
What’s funny is before I read this I thought Dokku was just used as a convenient driver for kitchen testing and stuff like that. I never really thought of it as a PaaS!
By @0xblinq - 4 months
Dokku is AMAZING. I’ve been using it for about 6 years, never had a single problem with it and I host a lot of apps on a single instance server. Can’t recommend it enough
By @hobo_mark - 4 months
Can I not do all of these things with docker-compose already?
By @mjcurl - 4 months
I've been using dokku for years. Constant useful updates over time and the developer was super helpful with a niche case using old documentation.
By @eeue56 - 4 months
Currently using Convox a lot, but miss the simplicity of Heroku. Anyone know if there's a good comparison breakdown of all the PaaS options out there?
By @m3kw9 - 4 months
I feel like this is similar to trying out Docker to use for small side projects for the first time, lots of gotchas that is hidden
By @pawurb - 4 months
I love dokku! I've been running my SAAS seamlessly with it for 5+ years now. It's awesome to see it actively maintained.
By @timetraveller26 - 4 months
I feel like a caveman doing this with a git bare repository and a hook, one of this days I am going to give Dokku a try!
By @scottydelta - 4 months
Looks promising, I have been self hosting a lot of apps, this can make things easier.
By @password4321 - 4 months
How well does Dokku support running on ARM?
By @rcarmo - 4 months
Obligatory mention of Piku as a Dockerless alternative: http://piku.github.io/
By @Animats - 4 months
"Serverless platform" is an oxymoron.

But it worked for Salesforce, which is a software company whose slogan is "no software".

By @amelius - 4 months
Let me guess ... it's called serverless but it still has a server somewhere in the equation?