<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dokku on Mitja Martini</title><link>https://mitjamartini.com/en/tags/dokku/</link><description>Recent content in Dokku on Mitja Martini</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Mitja Martini</copyright><lastBuildDate>Tue, 13 Jan 2026 18:21:46 +0200</lastBuildDate><atom:link href="https://mitjamartini.com/en/tags/dokku/index.xml" rel="self" type="application/rss+xml"/><item><title>From 8 Lines with Dokku to 200 with Kubernetes – Why I'm Still Switching</title><link>https://mitjamartini.com/en/posts/2026/01/from-8-lines-with-dokku-to-200-with-k8s/</link><pubDate>Tue, 13 Jan 2026 18:21:46 +0200</pubDate><guid>https://mitjamartini.com/en/posts/2026/01/from-8-lines-with-dokku-to-200-with-k8s/</guid><description>&lt;p&gt;So far, my web apps run on a Dokku server. I haven&amp;rsquo;t tried Vercel or Fly because I didn&amp;rsquo;t want to deal with complex pricing models that incur more costs with every additional project.&lt;/p&gt;
&lt;p&gt;Dokku works like Heroku:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku apps:create myapp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku postgres:create myapp-db
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku postgres:link myapp-db myapp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku config:set myapp &lt;span class="nv"&gt;APP_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;openssl rand -base64 48&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku git:from-image myapp myregistry.example.com/image:tag
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku domains:set myapp myapp.mitjas.com
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku ports:set myapp http:80:8000 https:443:8000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dokku letsencrypt:enable myapp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It doesn&amp;rsquo;t get any simpler. After just 8 lines I have&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an app on the server,&lt;/li&gt;
&lt;li&gt;a PostgreSQL DB with a user and password,&lt;/li&gt;
&lt;li&gt;the app linked to Postgres,&lt;/li&gt;
&lt;li&gt;a secret configured,&lt;/li&gt;
&lt;li&gt;the app deployed from a Docker image,&lt;/li&gt;
&lt;li&gt;a reverse proxy configured to forward HTTP and HTTPS to the app&amp;rsquo;s container, and&lt;/li&gt;
&lt;li&gt;TLS with certificates signed by Let&amp;rsquo;s Encrypt (including automatic renewal).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With Kubernetes I need almost &lt;strong&gt;200 lines of YAML&lt;/strong&gt; for this. Why do I still want to switch to Kubernetes?&lt;/p&gt;
&lt;p&gt;Dokku is great for small projects that can make do with the Dokku plugins and run on a single server. But I believe Kubernetes is a better fit for me in the long run.&lt;/p&gt;
&lt;p&gt;Kubernetes manifests tell me (and LLMs) what&amp;rsquo;s running on the cluster, and I can continuously develop and improve them. Dokku, in contrast, feels like &amp;ldquo;fire, forget, and start from scratch.&amp;rdquo; Other advantages of Kubernetes like better scalability, more choice, and security are nice, too, but for me the most important advantage right now is:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kubernetes is well-suited for Vibe Coding.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s my assumption, anyway. Let&amp;rsquo;s see how it goes.&lt;/p&gt;</description></item><item><title>Deploy a Static Site on Dokku</title><link>https://mitjamartini.com/en/posts/deploy-static-site-on-dokku/</link><pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate><guid>https://mitjamartini.com/en/posts/deploy-static-site-on-dokku/</guid><description>&lt;p&gt;This article describes how to deploy a static site on Dokku, including activating Let&amp;rsquo;s encrypt signed certificates for the domain.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h2 class="relative group"&gt;Configure DNS
&lt;div id="configure-dns" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#configure-dns" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Register the domain and point it to the Dokku server. I usually set these records in the domain&amp;rsquo;s DNS zone:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A @ &lt;span class="m"&gt;7200&lt;/span&gt; &lt;span class="nv"&gt;$DOKKU_SERVER_IPv4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A * &lt;span class="m"&gt;7200&lt;/span&gt; &lt;span class="nv"&gt;$DOKKU_SERVER_IPv4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CNAME www &lt;span class="m"&gt;7200&lt;/span&gt; &lt;span class="nv"&gt;$APP_DOMAIN&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AAAA @ &lt;span class="m"&gt;7200&lt;/span&gt; &lt;span class="nv"&gt;$DOKKU_SERVER_IPv6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AAAA * &lt;span class="m"&gt;7200&lt;/span&gt; &lt;span class="nv"&gt;$DOKKU_SERVER_IPv6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 class="relative group"&gt;Create a git repository
&lt;div id="create-a-git-repository" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#create-a-git-repository" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Create a folder and turn it into a git repository:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir static-dokku
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; static-dokku
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git init .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add an &lt;code&gt;index.html&lt;/code&gt; file with the desired content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;hi&amp;#34;&lt;/span&gt; &amp;gt; index.html
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create an empty &lt;code&gt;.static&lt;/code&gt; file. This tells Dokku that the repository contains a static site. Dokku then uses the Nginx builder to serve it.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;touch .static
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Commit the changes to git:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git add .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git commit -m &lt;span class="s2"&gt;&amp;#34;initial commit&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 class="relative group"&gt;Create an app on the Dokku host and git push to deploy the app
&lt;div id="create-an-app-on-the-dokku-host-and-git-push-to-deploy-the-app" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#create-an-app-on-the-dokku-host-and-git-push-to-deploy-the-app" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Use these commands to create, configure, and deploy the site:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;DOKKU_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your dokku server&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;APP_DOMAIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your app domain&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;APP_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your app name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh dokku@&lt;span class="nv"&gt;$DOKKU_HOST&lt;/span&gt; apps:create &lt;span class="nv"&gt;$APP_NAME&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git remote add dokku dokku@&lt;span class="nv"&gt;$DOKKU_HOST&lt;/span&gt;:&lt;span class="nv"&gt;$APP_NAME&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push dokku main
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh dokku@&lt;span class="nv"&gt;$DOKKU_HOST&lt;/span&gt; domains:add &lt;span class="nv"&gt;$APP_NAME&lt;/span&gt; &lt;span class="nv"&gt;$APP_DOMAIN&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh dokku@&lt;span class="nv"&gt;$DOKKU_HOST&lt;/span&gt; letsencrypt:enable &lt;span class="nv"&gt;$APP_NAME&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it. The site is now live at &lt;a
href=""&gt;your app domain&lt;/a&gt;.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Deploy updates
&lt;div id="deploy-updates" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#deploy-updates" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Updates can be deployed by checking them into git and running this command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push dokku main
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 class="relative group"&gt;Serving from sub directory
&lt;div id="serving-from-sub-directory" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#serving-from-sub-directory" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Serving files from a subdirectory (eg. &lt;code&gt;public&lt;/code&gt;) is possible by setting the &lt;code&gt;NGINX_ROOT&lt;/code&gt; environment variable of the app on the Dokku host:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh dokku@&lt;span class="nv"&gt;$DOKKU_HOST&lt;/span&gt; config:set &lt;span class="nv"&gt;$APP_NAME&lt;/span&gt; &lt;span class="nv"&gt;NGINX_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/app/www/public
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 class="relative group"&gt;Building the site during deployment
&lt;div id="building-the-site-during-deployment" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#building-the-site-during-deployment" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;If you want to build the site during deployment, you can use multiple &lt;a
href="https://dokku.com/docs/deployment/builders/herokuish-buildpacks/"
target="_blank"
&gt;buildpacks&lt;/a&gt;, for example by adding a &lt;code&gt;.buildpacks&lt;/code&gt; file to the root directory of the repository.&lt;/p&gt;
&lt;p&gt;This way, you can use the first buildpack for building and the second fro serving.&lt;/p&gt;
&lt;p&gt;Another, even more flexible option is to use &lt;a
href="https://dokku.com/docs/deployment/builders/dockerfiles/"
target="_blank"
&gt;Dockerfile deployments&lt;/a&gt; with &lt;a
href="https://docs.docker.com/build/building/multi-stage/"
target="_blank"
&gt;multi-stage builds&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Dokku SSH Alias</title><link>https://mitjamartini.com/en/posts/dokku-ssh-alias/</link><pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate><guid>https://mitjamartini.com/en/posts/dokku-ssh-alias/</guid><description>A quick tip to make working a bit easier.</description></item><item><title>Deploying a SaaS Pegasus Based Django App on Dokku</title><link>https://mitjamartini.com/en/posts/deploying-a-django-app-on-dokku/</link><pubDate>Sun, 22 Sep 2024 00:00:00 +0000</pubDate><guid>https://mitjamartini.com/en/posts/deploying-a-django-app-on-dokku/</guid><description>In this post I&amp;rsquo;ll share the steps I did to deploy a SaaS Pegasus bootstrapped Django app (Scriv from the SaaS Pegasus marketplace to be precise) with Celery, Redis and Postgres on a Dokku host. There were some hickups along the way, but I believe, when you go step-by-step, it is quite straightforward.</description></item></channel></rss>