Skills2026年4月10日·1 分钟阅读

Dokku — The Smallest PaaS Implementation You've Ever Seen

Dokku is a Docker-powered PaaS that helps you build and manage app lifecycles. git push to deploy, automatic SSL, plugin ecosystem — your own Heroku on a single server.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
先审查命令
npx -y tokrepo@latest install ed054bbe-34d8-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Dokku is a self-hosted, Docker-powered PaaS that lets you git push to deploy apps with automatic SSL and a plugin ecosystem.
§01

What it is

Dokku is a Docker-powered Platform as a Service (PaaS) that runs on a single server. It provides Heroku-style git push deployments, automatic SSL certificates via Let's Encrypt, a plugin ecosystem for databases and services, and support for Buildpacks, Dockerfiles, and Docker images. It is the smallest PaaS implementation you can deploy on a single VPS.

It targets individual developers, small teams, and side projects that need simple deployment without managing Kubernetes or complex CI/CD pipelines. A $5/month VPS with Dokku can host multiple applications.

§02

How it saves time or tokens

Dokku eliminates the need for manual deployment scripts, Nginx configuration, and SSL certificate management. Push your code with git push dokku main and Dokku builds a container, routes traffic, and provisions an SSL certificate automatically. Adding a database is one command: dokku postgres:create mydb.

For small projects, Dokku replaces the entire DevOps pipeline. There is no CI/CD system to configure, no container registry to manage, and no orchestrator to learn. The operational overhead is minimal.

§03

How to use

  1. Install Dokku on a fresh Ubuntu server with the bootstrap script. Point your domain's DNS to the server.
  2. Create an app: dokku apps:create myapp. Add a Git remote: git remote add dokku dokku@server:myapp.
  3. Push your code: git push dokku main. Dokku detects the language, builds the container, and routes traffic to it.
§04

Example

# Install Dokku on Ubuntu
wget -NP . https://dokku.com/bootstrap.sh
sudo DOKKU_TAG=v0.34.0 bash bootstrap.sh

# Create an app and deploy
dokku apps:create my-api
git remote add dokku dokku@your-server.com:my-api
git push dokku main

# Add a PostgreSQL database
dokku plugin:install https://github.com/dokku/dokku-postgres.git
dokku postgres:create my-db
dokku postgres:link my-db my-api

# Enable automatic HTTPS
dokku letsencrypt:enable my-api

# Set environment variables
dokku config:set my-api API_KEY=secret123
§05

Related on TokRepo

§06

Common pitfalls

  • Running Dokku on a server with less than 1 GB of RAM. Docker builds consume significant memory. Applications plus databases on a 512 MB server will run into OOM kills. Use at least 1 GB RAM with swap configured.
  • Not setting up persistent storage for databases. Dokku database plugins store data in Docker volumes by default. If you reinstall Dokku or remove a plugin without exporting data first, database contents are lost. Set up regular backups with dokku postgres:export.
  • Deploying stateful applications that write to the local filesystem. Dokku containers are ephemeral and rebuilt on every deploy. Files written inside the container are lost. Use Dokku's persistent storage plugin to mount host directories for file uploads.

常见问题

How does Dokku compare to Heroku?+

Dokku provides a similar developer experience to Heroku: git push deployment, buildpack support, add-on plugins, and environment variable management. The difference is that Dokku runs on your own server. You pay for server costs instead of per-dyno pricing. Dokku lacks Heroku's managed scaling and marketplace but covers most deployment needs.

What languages and frameworks does Dokku support?+

Dokku supports any language that has a Buildpack or Dockerfile. This includes Node.js, Python, Ruby, Go, Java, PHP, Clojure, Scala, and more through Heroku buildpacks. You can also deploy pre-built Docker images directly.

How do I add databases to Dokku?+

Dokku has official plugins for PostgreSQL, MySQL, Redis, MongoDB, Elasticsearch, and RabbitMQ. Install a plugin and create a database with two commands. Linking a database to an app automatically sets the DATABASE_URL environment variable.

Can Dokku handle multiple apps on one server?+

Yes. Dokku routes traffic to different apps based on domain names using Nginx. A single server can host dozens of small applications. Each app runs in its own Docker container with isolated resources. Configure memory and CPU limits per app to prevent resource contention.

Does Dokku support zero-downtime deployments?+

Yes. Dokku performs zero-downtime deployments by default. It starts the new container, waits for health checks to pass, then switches traffic from the old container to the new one. If the new container fails health checks, the deployment is rolled back automatically.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产