shtukbasehub

Own server

Run a Shtukbase space on a VPS with Bun, Docker or systemd, and Caddy.

Packageown-serverv0.1.05 files

Own server

Run the same space API and MCP endpoint on your VPS. The container uses the official Bun image with the shtuk source and its package catalog. Build from the repository root so Docker can copy both.

On a VPS with Bun, Docker, OpenSSL and Caddy installed, point your domain at the VPS, allow ports 80 and 443, and replace space.example.com in the Caddyfile. Run these five commands as your VPS user from the repository root. Start with a fresh space directory or use your existing initialized space in the mount.

bun apps/shtuk/src/cli.ts init "$HOME/shtuk-space" --blueprint ./apps/standard/packages/blueprint-leads --defaults
(umask 077 && set -C && openssl rand -hex 32 > "$HOME/.shtuk-own-server-token")
docker build -t shtuk-own-server -f apps/standard/packages/own-server/Dockerfile .
docker run -d --restart unless-stopped --name shtuk --user "$(id -u):$(id -g)" -p 127.0.0.1:8780:8780 --mount "type=bind,src=$HOME/shtuk-space,dst=/space" --mount "type=bind,src=$HOME/.shtuk-own-server-token,dst=/run/shtuk-token,readonly" shtuk-own-server
sudo caddy run --adapter caddyfile --config apps/standard/packages/own-server/Caddyfile

Open the HTTPS address and enter the space token. The API and MCP accept the same token as a Bearer credential. Keep the token file outside the space and the build context. Keep port 8780 on loopback. Caddy preserves the public Host and sets X-Forwarded-Proto, so serve can check the browser origin and mark its session cookie Secure for HTTPS. Use your Caddy service to keep the proxy running after the terminal closes.

systemd without Docker

Put the repository at /opt/shtukbase and Bun at /usr/local/bin/bun. Create a system user and group named shtuk and give them write access to the initialized space at /var/lib/shtuk/space. Put the token in the root-owned file /etc/shtukbase/token with mode 0600. Copy shtuk.service to /etc/systemd/system/, then run sudo systemctl daemon-reload and sudo systemctl enable --now shtuk. Use the same Caddy configuration.

Back up the mounted space folder, including its installed packages and history if present. Keep the credential backup separate. When upgrading, keep the space bind mount and token file and replace the container with one built from the new revision.