From source
The repository’s deploy/ directory builds the image from source instead of pulling it, and reads
Redis’s settings from deploy/redis.conf.
git clone https://github.com/Mark7888/two-place-pastecd two-place-paste/deploy
cp .env.example .env$EDITOR .env # set TPP_PUBLIC_BASE_URL and ADMIN_PASSWORD
docker compose up -d --buildcurl -fsS http://127.0.0.1:8080/healthz # → okUpgrade with git pull && docker compose up -d --build.
deploy/docker-compose.yml also contains an optional MinIO service — see
Blob storage (the MinIO with compose tab).
-
Install Go 1.26, Node.js 24 or newer, and Redis 7. On Debian or Ubuntu, Redis is
apt install redis-server. Node is only needed to build the admin page; the relay does not run it. -
Configure Redis for TwoPlacePaste. These two settings are required, not tuning — see why:
/etc/redis/redis.conf appendonly yesmaxmemory-policy volatile-lrumaxmemory 512mbRestart Redis afterwards.
-
Build the relay. First build the admin page, which the binary embeds, then the binary itself from the repository root: the Go workspace (
go.work) links the server to the shared client module.Terminal window git clone https://github.com/Mark7888/two-place-pastecd two-place-paste(cd server/ui && npm ci && npm run build)CGO_ENABLED=0 go build -C server -trimpath -ldflags="-s -w" -o /tmp/tpp ./cmd/tppsudo install -m 0755 /tmp/tpp /usr/local/bin/tppA binary built without the first step still runs, but its admin page only says that the UI is missing.
-
Create a user, a blob directory and the settings file.
Terminal window sudo useradd --system --home /var/lib/tpp --shell /usr/sbin/nologin tppsudo install -d -o tpp -g tpp -m 0750 /var/lib/tpp/blobssudo install -d -m 0750 /etc/tppsudo cp deploy/.env.example /etc/tpp/tpp.envsudo chmod 0640 /etc/tpp/tpp.env && sudo chgrp tpp /etc/tpp/tpp.envIn
/etc/tpp/tpp.env, set at least:/etc/tpp/tpp.env TPP_PUBLIC_BASE_URL=https://tpp.example.comADMIN_PASSWORD=pick-a-long-random-passwordTPP_HTTP_ADDR=127.0.0.1:8080TPP_REDIS_ADDR=127.0.0.1:6379TPP_BLOB_ROOT=/var/lib/tpp/blobs -
Add a systemd unit.
/etc/systemd/system/tpp.service [Unit]Description=TwoPlacePaste relayAfter=network-online.target redis-server.serviceWants=network-online.target[Service]User=tppGroup=tppEnvironmentFile=/etc/tpp/tpp.envExecStart=/usr/local/bin/tpp serveRestart=on-failureNoNewPrivileges=trueProtectSystem=strictProtectHome=truePrivateTmp=trueReadWritePaths=/var/lib/tpp[Install]WantedBy=multi-user.targetTerminal window sudo systemctl daemon-reloadsudo systemctl enable --now tppcurl -fsS http://127.0.0.1:8080/healthz # → okjournalctl -u tpp -f # logs, one JSON object per line
To upgrade, pull, rebuild (the admin page too), install the new binary and
sudo systemctl restart tpp.