Install
Three routes to the same server. The installer bootstraps a complete Docker stack (server, web client, edge, PostgreSQL, object storage) with one command. Docker Compose walks the same stack by hand. The manual build runs the single Go binary against your own PostgreSQL.
When the server runs, see Clients for the device apps.
Requires: git, docker with the compose plugin. One command clones,
builds and boots everything, then asks for ports and admin credentials:
git clone https://github.com/gochathub/gochathub-installer
cd gochathub-installer
./install.sh ~/gochathub --public-host chat.example.com --admin alice
TLS is not part of the stack — terminate it at your own upstream proxy
and give the installer the browser-visible host (--public-host). It
generates the deployment dir (docker-compose.yml, Caddyfile, Makefile),
clones both apps at pinned SHAs, builds the images and starts the stack.
Common flags:
| Flag | Meaning |
|---|---|
[target-dir] | deployment directory (default ./gochathub-deploy) |
--port N / --minio-port N | edge HTTP + MinIO S3 ports (strict: fails if taken) |
--public-host HOST[:PORT] | browser-visible host; drives session origin + attachment URLs (https default) |
--http | plain-HTTP LAN mode without a proxy |
--admin NAME + ADMIN_PASSWORD env | initial admin account |
Everything below runs inside the deployment directory
(make targets and the ghc CLI wrapper are generated there):
make update # advance pinned SHAs, rebuild, restart — data safe
make backup # pg_dump → backups/db-<ts>.sql.gz
make logs / status
./ghc user list
./ghc user create alice # server CLI, works while stopped
The installer README covers the rest: scripted --non-interactive deploys,
Cloudflare Turnstile on the sign-in form, PWA install + Web Push, the
nginx/Caddy upstream proxy snippets, and ntfy for Android push.
The same stack the installer produces, built by hand — useful when you want to read every moving part before running them.
- Clone the installer repo (compose file, Caddyfile and Dockerfiles come from it) plus both applications:
git clone https://github.com/gochathub/gochathub-installer
cd gochathub-installer
git clone https://github.com/gochathub/gochathub-server clones/gochathub-server
git clone https://github.com/gochathub/gochathub-webui clones/gochathub-webui
- Write the environment file — the HTTPS-behind-a-proxy flavor
(
SCHEME/COOKIE_SECUREassume TLS terminates upstream):
cat > .env <<'EOF'
POSTGRES_USER=gochathub
POSTGRES_PASSWORD=change-me
POSTGRES_DB=gochathub
MINIO_ROOT_USER=gochathub
MINIO_ROOT_PASSWORD=change-me
S3_BUCKET=gochat
PUBLISHED_PORT=8080
MINIO_PUBLISHED_PORT=9000
MINIO_BIND=127.0.0.1:
PUBLIC_HOST=chat.example.com
SCHEME=https
COOKIE_SECURE=true
S3_ENDPOINT_URL=http://minio:9000
S3_PUBLIC_ENDPOINT=https://chat.example.com
S3_USE_TLS=false
EOF
- Generate the two files the installer would create for you, then build and start:
printf '*\n!clones/\n!clones/**\n!Caddyfile\n' > .dockerignore
docker compose build
docker compose up -d
docker compose build builds gochathub/server:local (Go server from the
clone) and gochathub/caddy:local (caddy with the web client’s production
bundle baked in). The edge publishes PUBLISHED_PORT; attachments ride
/<bucket>/* on the same host.
- Create an admin:
docker compose run --rm --quiet-pull server gochathub-server user create alice --password-stdin -
(The server CLI is the same ghc the installer wraps; run it without a
login shell wherever you need it.)
To update: git -C clones/gochathub-server pull && git -C clones/gochathub-webui pull, repeat step 3. Data lives in the pgdata/miniodata volumes.
Backups and the ntfy/Turnstile settings work exactly as on the installer — see the installer README.
No Docker required — one binary against your own PostgreSQL.
Prerequisites: Go 1.26+ and PostgreSQL 16+. Optional for full functionality: any S3-compatible object store (attachments) and a self-hosted ntfy server (UnifiedPush for Android).
Build — from a checkout of gochathub-server:
go build -o gochathub-server ./cmd/chatserverMigrate — start-up never migrates implicitly, apply first:
DATABASE_URL="postgres://user:pass@host:5432/gochathub" gochathub-server migrateDATABASE_URLis the only required setting.LISTEN_ADDRdefaults to:8080.Create an admin user:
gochathub-server user create alice # or: user list | passwd | enable | disable | deleteTokens print raw once — store them when you create them:
gochathub-server token create aliceServe:
gochathub-server serveThe server listens on
:8080. Point the web client at that URL and log in.Clients and API:
- Web client — set your server URL and sign in from any browser.
- Android — configure your server URL plus your UnifiedPush (ntfy) endpoint; message content never travels through the push transport.
- API — the full contract is the repo’s
api/openapi.yaml; the admin CLI reference isdocs/CLI.md.
First login lives in your own hands: accounts are created on the server (CLI as shown above), there is no public signup.