You’ve been asked to stand up a self-hosted Jira alternative. The Plane README has you run docker compose up -d from the official compose file, you hit it on port 80, you hand it over. A quarter later, PostgreSQL is the default compose image — never backed up — and is still listening on 0.0.0.0:5432 because the compose ports block published it; the .env is a copy of .env.example with SECRET_KEY=secret; uploads live in a MinIO container with no bucket lifecycle; RabbitMQ retry loops in the logs are ignored; and a single admin account is shared among five engineers.
What’s happening
A Plane deployment that is actually production-ready needs more than docker compose up -d. PostgreSQL has to be on the docker network only — no ports: block exposing 5432 to the host; the same applies to Redis (6379), RabbitMQ (5672), and MinIO (9000/9001). The .env lives at /etc/plane/.env at mode 600 because it carries SECRET_KEY, POSTGRES_PASSWORD, RABBITMQ_DEFAULT_PASS, the MinIO root credentials, and the OIDC client secret. The worker and beat containers need to be running — docker compose ps is the only signal that notifications, view-counters, and webhooks are alive. OIDC SSO is the only acceptable identity story for an internal tool with PII; shared admin logins fail SOC 2 the first time someone leaves. And the upload bucket has to live somewhere that survives the host.
How to verify
After install, the listeners should look like this:
ss -lntp | grep -E ':(80|443)\b'
# 0.0.0.0:80 nginx
# 0.0.0.0:443 nginx
# (no 5432, 6379, 5672, 9000, or 9001 — those are docker-internal)
If you see 5432 or 6379 on 0.0.0.0, the compose ports block leaked the backing stores — fix it before any user logs in. Container health:
cd /opt/plane && docker compose ps --format 'table {{.Name}}\t{{.Status}}'
# plane-db-1 Up (healthy)
# plane-redis-1 Up (healthy)
# plane-mq-1 Up (healthy)
# plane-minio-1 Up
# plane-api-1 Up (healthy)
# plane-worker-1 Up
# plane-beat-1 Up
# plane-web-1 Up
# plane-proxy-1 Up
Admin URL through TLS:
curl -I https://plane.example.com/
# HTTP/2 200
# strict-transport-security: max-age=31536000; includeSubDomains
If any worker shows Restarting, RabbitMQ or Postgres is unreachable from the worker — usually a stale .env reference or a hostname typo.
The fix
Save the script below as /root/setup-plane-ubuntu22.sh, then run it. It runs base update + UFW + SSH hardening + unattended-upgrades, installs Docker CE from Docker’s apt repo, writes /etc/plane/.env with every generated secret, brings up a docker-compose stack (PostgreSQL + Redis + RabbitMQ + MinIO + Plane API/worker/beat/web/proxy) with no datastore ports exposed, installs nginx + certbot, and polls until the proxy container answers on its internal port before binding nginx.
#!/usr/bin/env bash
set -euo pipefail
### Ubuntu 22.04 Plane clean VM installer
### Keeps root SSH key login enabled
### Disables SSH password login
### Enables automatic security updates
### Installs Docker CE + Plane (Postgres, Redis, RabbitMQ, MinIO) + nginx + Let's Encrypt
### Datastores bound to docker network only
### No local backups; assumes VM-level backup
### Reboot remains manual
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run as root."
exit 1
fi
: "${PLANE_DOMAIN:?Set PLANE_DOMAIN=plane.example.com}"
: "${PLANE_EMAIL:?Set PLANE_EMAIL=ops@example.com for Let's Encrypt}"
PLANE_VERSION="${PLANE_VERSION:-v0.24.0}"
SECRET_KEY="$(openssl rand -hex 32)"
PG_PASS="$(openssl rand -hex 24)"
RMQ_PASS="$(openssl rand -hex 24)"
MINIO_ROOT_USER="planeadmin"
MINIO_ROOT_PASSWORD="$(openssl rand -hex 24)"
echo
echo "========================================"
echo "Plane Ubuntu 22.04 Setup"
echo "Domain: ${PLANE_DOMAIN}"
echo "Version: ${PLANE_VERSION}"
echo "========================================"
echo
echo "==> Updating base OS"
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade
echo "==> Installing base packages"
apt-get -y install \
vim curl wget ca-certificates gnupg2 \
chrony fail2ban unattended-upgrades \
ufw lsof tcpdump dnsutils tar gzip git \
iproute2 net-tools openssl \
software-properties-common
echo "==> Enabling time sync"
systemctl enable --now chrony
timedatectl set-ntp true
echo "==> Applying kernel/network tuning"
cat > /etc/sysctl.d/99-plane.conf <<'SYSCTL'
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.core.somaxconn = 4096
net.core.netdev_max_backlog = 250000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 10240 65535
kernel.dmesg_restrict = 1
kernel.kptr_restrict = 2
fs.file-max = 2097152
vm.max_map_count = 262144
SYSCTL
modprobe tcp_bbr || true
echo tcp_bbr > /etc/modules-load.d/bbr.conf
sysctl --system
echo "==> Setting file limits"
cat > /etc/security/limits.d/99-plane.conf <<'LIMITS'
* soft nofile 64000
* hard nofile 64000
root soft nofile 64000
root hard nofile 64000
LIMITS
echo "==> Configuring UFW"
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw --force enable
echo "==> Hardening SSH while keeping root key login enabled"
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)
set_sshd_option() {
local key="$1"
local value="$2"
if grep -qE "^[#[:space:]]*${key}[[:space:]]+" /etc/ssh/sshd_config; then
sed -i "s|^[#[:space:]]*${key}[[:space:]].*|${key} ${value}|" /etc/ssh/sshd_config
else
echo "${key} ${value}" >> /etc/ssh/sshd_config
fi
}
set_sshd_option PermitRootLogin prohibit-password
set_sshd_option PasswordAuthentication no
set_sshd_option PubkeyAuthentication yes
set_sshd_option KbdInteractiveAuthentication no
set_sshd_option ChallengeResponseAuthentication no
set_sshd_option X11Forwarding no
set_sshd_option ClientAliveInterval 300
set_sshd_option ClientAliveCountMax 2
set_sshd_option MaxAuthTries 4
sshd -t
systemctl restart ssh
echo "==> Configuring fail2ban"
cat > /etc/fail2ban/jail.d/sshd.local <<'FAIL2BAN'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
findtime = 10m
bantime = 1h
FAIL2BAN
systemctl enable --now fail2ban
echo "==> Configuring unattended-upgrades"
cat > /etc/apt/apt.conf.d/20auto-upgrades <<'AUTOUPG'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";
AUTOUPG
echo "==> Installing Docker CE"
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get -y install docker-ce docker-ce-cli containerd.io \
docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker
echo "==> Writing /etc/plane/.env"
mkdir -p /etc/plane
cat > /etc/plane/.env <<ENV
APP_RELEASE=${PLANE_VERSION}
WEB_URL=https://${PLANE_DOMAIN}
DEBUG=0
CORS_ALLOWED_ORIGINS=https://${PLANE_DOMAIN}
SECRET_KEY=${SECRET_KEY}
POSTGRES_USER=plane
POSTGRES_PASSWORD=${PG_PASS}
POSTGRES_DB=plane
POSTGRES_HOST=plane-db
PGDATA=/var/lib/postgresql/data
DATABASE_URL=postgresql://plane:${PG_PASS}@plane-db:5432/plane
REDIS_HOST=plane-redis
REDIS_PORT=6379
REDIS_URL=redis://plane-redis:6379/
RABBITMQ_DEFAULT_USER=plane
RABBITMQ_DEFAULT_PASS=${RMQ_PASS}
RABBITMQ_HOST=plane-mq
RABBITMQ_PORT=5672
AMQP_URL=amqp://plane:${RMQ_PASS}@plane-mq:5672/
USE_MINIO=1
AWS_REGION=
AWS_ACCESS_KEY_ID=${MINIO_ROOT_USER}
AWS_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}
AWS_S3_ENDPOINT_URL=http://plane-minio:9000
AWS_S3_BUCKET_NAME=uploads
MINIO_ROOT_USER=${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
FILE_SIZE_LIMIT=5242880
ENABLE_SIGNUP=0
ENABLE_EMAIL_PASSWORD=1
ENABLE_MAGIC_LINK_LOGIN=0
OPENID_ENABLED=0
OPENID_CLIENT_ID=
OPENID_CLIENT_SECRET=
OPENID_DISCOVERY_URL=
ENV
chmod 600 /etc/plane/.env
chown root:root /etc/plane/.env
echo "==> Writing docker-compose.yml at /opt/plane"
mkdir -p /opt/plane
ln -sf /etc/plane/.env /opt/plane/.env
cat > /opt/plane/docker-compose.yml <<'COMPOSE'
name: plane
x-app-env: &app-env
env_file:
- .env
services:
plane-db:
image: postgres:15.5-alpine
container_name: plane-db
restart: unless-stopped
<<: *app-env
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 6
plane-redis:
image: valkey/valkey:7.2.5-alpine
container_name: plane-redis
restart: unless-stopped
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 6
plane-mq:
image: rabbitmq:3.13.6-management-alpine
container_name: plane-mq
restart: unless-stopped
<<: *app-env
volumes:
- rabbitmqdata:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 15s
timeout: 10s
retries: 6
plane-minio:
image: minio/minio:RELEASE.2024-09-13T20-26-02Z
container_name: plane-minio
restart: unless-stopped
<<: *app-env
command: server /export --console-address ":9001"
volumes:
- miniodata:/export
api:
image: makeplane/plane-backend:${APP_RELEASE}
container_name: plane-api
restart: unless-stopped
<<: *app-env
command: ./bin/docker-entrypoint-api.sh
depends_on:
plane-db:
condition: service_healthy
plane-redis:
condition: service_healthy
plane-mq:
condition: service_healthy
plane-minio:
condition: service_started
worker:
image: makeplane/plane-backend:${APP_RELEASE}
container_name: plane-worker
restart: unless-stopped
<<: *app-env
command: ./bin/docker-entrypoint-worker.sh
depends_on:
api:
condition: service_started
beat:
image: makeplane/plane-backend:${APP_RELEASE}
container_name: plane-beat
restart: unless-stopped
<<: *app-env
command: ./bin/docker-entrypoint-beat.sh
depends_on:
api:
condition: service_started
web:
image: makeplane/plane-frontend:${APP_RELEASE}
container_name: plane-web
restart: unless-stopped
<<: *app-env
command: node web/server.js
depends_on:
api:
condition: service_started
proxy:
image: makeplane/plane-proxy:${APP_RELEASE}
container_name: plane-proxy
restart: unless-stopped
<<: *app-env
ports:
- "127.0.0.1:8080:80"
depends_on:
web:
condition: service_started
api:
condition: service_started
volumes:
pgdata:
redisdata:
rabbitmqdata:
miniodata:
COMPOSE
chmod 640 /opt/plane/docker-compose.yml
echo "==> docker compose pull + up -d"
cd /opt/plane
docker compose pull
docker compose up -d
echo "==> Waiting for the Plane proxy to answer on 127.0.0.1:8080"
for i in {1..120}; do
if curl -sf -o /dev/null http://127.0.0.1:8080/; then
break
fi
sleep 2
done
if ! curl -sf -o /dev/null http://127.0.0.1:8080/; then
echo "Plane proxy did not respond on 127.0.0.1:8080"
docker compose ps
docker compose logs --tail 200 proxy web api || true
exit 1
fi
echo "==> Installing nginx and certbot"
apt-get -y install nginx certbot python3-certbot-nginx
cat > /etc/nginx/sites-available/plane <<NGINX
server {
listen 80;
listen [::]:80;
server_name ${PLANE_DOMAIN};
return 301 https://\$host\$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${PLANE_DOMAIN};
client_max_body_size 50M;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options SAMEORIGIN always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
NGINX
ln -sf /etc/nginx/sites-available/plane /etc/nginx/sites-enabled/plane
rm -f /etc/nginx/sites-enabled/default
nginx -t
systemctl enable --now nginx
systemctl reload nginx
certbot --nginx --non-interactive --agree-tos \
-m "${PLANE_EMAIL}" -d "${PLANE_DOMAIN}" --redirect
systemctl enable --now certbot.timer
echo "==> Final package update"
apt-get -y upgrade
echo
echo "========================================"
echo "DONE"
echo "========================================"
echo
echo "Kernel:"
uname -r
echo
echo "Services:"
systemctl is-active docker nginx fail2ban chrony || true
echo
echo "Compose status:"
cd /opt/plane && docker compose ps --format 'table {{.Name}}\t{{.Status}}'
echo
echo "Listeners:"
ss -lntp | grep -E ':(80|443)\b' || true
echo
echo "Web UI:"
echo "https://${PLANE_DOMAIN}/"
echo
echo "Credentials (record to your password manager NOW):"
echo " SECRET_KEY: ${SECRET_KEY}"
echo " POSTGRES_PASSWORD: ${PG_PASS}"
echo " RABBITMQ_DEFAULT_PASS:${RMQ_PASS}"
echo " MINIO_ROOT_USER: ${MINIO_ROOT_USER}"
echo " MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}"
echo
echo "OIDC SSO (manual, post-install):"
echo " Register an OIDC client at your IdP (Authentik, Keycloak, Okta, etc.)"
echo " Redirect: https://${PLANE_DOMAIN}/auth/oidc/callback/"
echo " Set OPENID_ENABLED=1, OPENID_CLIENT_ID, OPENID_CLIENT_SECRET,"
echo " OPENID_DISCOVERY_URL in /etc/plane/.env"
echo " Then: cd /opt/plane && docker compose up -d --force-recreate api worker beat web"
echo
echo "Final step:"
echo "Open the URL, create the first workspace owner, then enable OIDC and disable email signup."
Make it executable and run it:
chmod 700 /root/setup-plane-ubuntu22.sh
PLANE_DOMAIN=plane.example.com PLANE_EMAIL=ops@example.com /root/setup-plane-ubuntu22.sh
Image pulls plus first migration finish in 6 to 10 minutes on a 4 vCPU / 8 GB VM. After the script prints the URL, create the first workspace owner, then go to God Mode > Authentication and switch to OIDC against your IdP using the redirect URI printed at the end. The script does not configure host-level backups; the docker volumes pgdata, rabbitmqdata, and miniodata are the stateful surfaces and the assumption is the VM has snapshot/backup at the cloud layer or the MinIO bucket is replicated to an external S3 target.
Run the production Plane on a Stack Harbor-managed PaaS with patching cadence, monitoring, and on-call escalation built in: Cloud PaaS →.