Skip to content

More with Dokploy

Author's photo
4 min read·

As you might already know, I’m a big fan of Dokploy. Last year I migrated my hosted websites and apps from a Dokku-managed server to Dokploy and I couldn’t be happier about it.

This autumn, seeing the avalanche of RCEs and critical-level vulnerabilities disclosed for almost every software project that runs the internet, I’ve decided that it’s time to tighten up my setup, minimizing the attack surface.

The before

The setup was dead simple:

  • a simple VPS with enough resources
  • it was running a Dokploy control panel
  • multiple fairly low-load websites and web-apps next to it, on the same machine
  • another machine running a Harbor instance — a Docker registry to pull images of my apps from

There were a couple of problems with it:

  • the websites had short downtime every time I needed to upgrade the control panel
  • during deployments and builds, the load spike could affect the customer-facing apps
  • wide attack surface on the server — multiple apps, including admin-level control running on a machine open to the internet
  • if an attacker gets into the machine — it’s over, for the control panel and the websites, all at once

The upgrade

Since last year I’ve been curious to try its Remote Servers feature. It allows having one or more additional servers taking the workload. Deploy Servers — to run the apps. And Build Servers, well, to build apps :)

A friend of mine also recommended trying Forgejo, which I was also curious to give a try. Removing the dependency on GitHub with its 92% uptime was something I wanted to do long ago.

So the new setup I’ve come to was this:

  • A main control server running:
    • Dokploy instance
    • Forgejo code repository, doubling as a Docker packages repository
    • Locked down from internet access
    • Linked to my Tailscale network, so I can use the web apps it’s running from my local computer
  • An additional deploy server running the production apps
    • Open to the internet, obviously
    • Cannot connect back to the control machine
    • Isolated from the Dokploy deployments workload usage peaks
Diagram of the upgraded setup: the control server with Dokploy and Forgejo sits behind the Hetzner firewall, reachable only via Tailscale, and deploys one-way to the public deploy server. The control server gets TLS certificates via the DNS-01 challenge; the deploy server — via HTTP-01.

Learnings

  1. Forgejo is really really nice. I am happy to replace Harbor, as it was overkill for my needs.

  2. Hetzner firewall feature is super easy to use and helps to protect your servers at the network level.

  3. If your server is not accessible from the internet, but you still want to protect its web traffic with TLS, you can still issue Let’s Encrypt certificates using the DNS-01 challenge.

    For that you have to use one of the DNS providers supported by Lego. Lego is the underlying library used by Traefik for ACME DNS challenges: see Traefik docs on dnsChallenge.

  4. There’s one risk I really hate about using Hetzner as a DNS provider. To link it up to Traefik, I had to issue an API token and pass it via an environment variable. The problem is that the token is not limited to the DNS settings API and can be used to manage all your Hetzner resources, including servers.

    I was surprised to learn that. I find it unacceptable for a popular cloud provider.

Conclusions

This was an exciting exercise. It’s amazing how much you can do simply by relying on free and open tools. I now feel relief having more confidence in the setup. And as always, being competent and knowing it is a great feeling. :)

And you? Do you manage your servers yourself? Have you tried any of the above?

Let me know on LinkedIn.

Cheers! 🖖

End of article