Governate
Sign in Start a trial

Installing with Docker

The quickest way to run Governate on a server of your own. You receive an install kit, a small folder, and the names of two container images. The kit runs three things on one Linux machine: the server, the document viewer, and a proxy that obtains TLS certificates by itself.

What you need

Install

sudo ./governate-install-linux-amd64

Use -arm64 on an ARM machine. The installer looks at the machine and then needs your choices. There are three ways to give them; pick the one that suits how you reach the server.

WayCommandWhen
The page, through an SSH tunnelsudo ./governate-install-linux-amd64The default. You reach the server by SSH. Nothing is opened to the network.
The page, at the server's own addresssudo ./governate-install-linux-amd64 -publicA tunnel is not possible. Needs port 8899 reachable from your computer.
No page: a file of choicessudo ./governate-install-linux-amd64 -plan plan.jsonScripted installs, or no browser at hand.

Through a tunnel. The installer prints an address and the exact ssh line to run on your own computer, in a second terminal:

ssh -L 8899:127.0.0.1:8899 you@the-server

Then open the printed address in your browser. The page is served to the server itself only; the tunnel carries it to you, encrypted by SSH.

At the server's own address. With -public the installer serves the page over HTTPS at each of the machine's addresses and prints them, so you can open https://<the server's IP>:8899/... directly, before any domain exists. It makes a certificate for the occasion, which no authority vouches for, so your browser warns. The installer prints the certificate's fingerprint; compare it with what the browser shows before going on. The address carries a key that lets its holder install, so keep it to yourself, and stop the installer when you are done.

From a file. -example prints a plan file to start from. Edit it and run with -plan; the installer says whether the machine looks big enough, starts everything and prints what happens. With "certs": "own", give the certificate and key as files with -cert and -key. A setting it does not know is refused, so that a misspelling is not silently ignored.

./governate-install-linux-amd64 -example > plan.json
sudo ./governate-install-linux-amd64 -plan plan.json

Whichever way, the two names you give for Governate and the viewer do not have to work yet when you open the installer: you reach it by tunnel, address or file. They have to point at the machine by the time you press Install and start with automatic certificates.

On the page you give the two addresses and choose, for each of three parts, where it runs:

PartDefaultOn this machineElsewhere
DatabaseBuilt in (SQLite)PostgreSQL in a containerA PostgreSQL you already run
Root keyA key fileOpenBao in a containerAn OpenBao or Vault you already run
File storeA folderAn S3 store (SeaweedFS) in a containerS3, Google Drive, OneDrive

The page also offers an activity collector: an OpenTelemetry collector beside Governate that writes a copy of every activity record to /opt/governate/activity/activity.jsonl. It is optional, and unlike the three parts above it can be added or removed at any time by running the installer again.

A part on this machine is set up for you, with secrets generated on the machine and written only to /opt/governate/.env. Governate then shows it as fixed. A part elsewhere is described afterwards, in Governate's own setup; see the setup guide. MySQL and Microsoft SQL Server are not available yet.

Beside the choices, a panel shows what they cost this machine: memory, disk and processors, each as a bar from green to red. The figures are estimates for a small team. A part that runs elsewhere costs this machine nothing, so a small machine can still carry an installation whose database and store are remote.

InstallationMemory to allow for
Smallest: server, viewer, proxyAbout 3 GB; a 4 GB machine works, 8 GB is comfortable
With PostgreSQL, OpenBao and the S3 store here tooAbout 4.5 GB; use an 8 GB machine

Then Install and start writes the files to /opt/governate, fetches the images and starts everything. When it finishes, continue to your address.

Certificates

The page asks how connections from browsers are secured. Whichever way, only TLS 1.3 is accepted.

ChoiceWhenWhat you give
AutomaticThe machine is reachable from the internet on ports 80 and 443, and both names point at itNothing. Public certificates are obtained and renewed for you
Your ownThe installation is internal, or your organisation issues its own certificatesOne certificate that covers both names (or a wildcard), and its key
Your own proxyA proxy or load balancer is already in frontThe two ports to publish; your proxy holds the certificates
Self-signedTrying it out on one machineNothing. Browsers warn, and each address has to be accepted once

With Automatic, the page looks both names up and says where they lead before anything is started. A name that does not resolve stops the installation, because failed requests count against the certificate authority's limits. Certificates are kept in the proxy-data volume: a restart, an update or running the installer again asks for nothing new. Do not delete that volume.

With Your own, the certificate is checked before it is saved: that the key belongs to it, that it covers both names and that it is in date. The key is written to /opt/governate/certs, readable only by the folder's owner. To renew, run the installer again and paste the new one.

With Your own proxy, forward the two names to the two ports as plain HTTP, WebSockets included, and secure them with TLS 1.3 yourself. The ports answer on this machine only unless you say the proxy is on another one.

Behind Cloudflare: with proxying off (DNS only) use Automatic. With proxying on, use Your own with a Cloudflare origin certificate, and know that Cloudflare can then read documents as they are viewed.

Your own registry, or no outside connection

The installer takes any image names, so the software can come from a registry you run instead of ours.

crane copy docker.io/startaworldpeace/governate-server:0.1.0 registry.example.com/governate/governate-server:0.1.0
crane copy docker.io/startaworldpeace/governate-viewer:cp-26.04.6-3 registry.example.com/governate/governate-viewer:cp-26.04.6-3

Name images by an exact version in a mirror, not latest, so that what runs is what you copied.

How the parts are arranged

The server and every part that runs beside it share one private network address, so they reach each other on 127.0.0.1 and no other container, and nothing outside the machine, can reach the database, the key service or the store. Only the proxy is published. This is the same arrangement as one pod with several containers, which is how the installation maps onto Kubernetes.

A key service on the same machineOpenBao in a container keeps its unseal key in a Docker volume on the same machine, so that the installation comes back by itself after a restart. Someone who takes the whole disk therefore has the root key too, as with a key file. It is a step towards a key service on another machine, which does not have that weakness.

Changing an installation

Run the installer again. Addresses, the kind of certificate, images and ports can change. Until the administrator has been created, where the database, the root key and the file store run can be changed too: the unfinished installation is started afresh with the new parts. An image named by an exact version is fetched once and then used as it is. One named latest is checked against the registry every time the installer runs, so running it again is how such an installation is updated; if the registry cannot be reached, the copy already on the machine is used and the installer says so. Once the installation has an account, a part cannot start or stop running on this machine, because what it holds would be left behind; moving one means moving its data first.

Without the page

sudo ./install.sh does the smallest installation by asking in the terminal, or with no questions when its answers are given in the environment.

Create the administrator straight awayA new installation has no accounts. Whoever opens it first creates the administrator. Do it as soon as the installer finishes.

Setup asks for the licence first; have the text from your Governate customer portal ready.

What is where

PathWhat it is
/opt/governate/.envEvery setting. Edit it, then run docker compose up -d in that folder.
/opt/governate/compose.yamlThe services, written by the installer for what was chosen.
/opt/governate/plan.jsonWhat was chosen. The installer reads it when run again.
/opt/governate/CaddyfileThe proxy's configuration.
The governate_data volumeDatabases, protected files and the root key, unless you moved them elsewhere.

The optional settings in .env, for PostgreSQL, S3, OpenBao and sign-in providers, are the ones described under Configuration.

Updating

Run the installer again with the new image names, or change SERVER_IMAGE and VIEWER_IMAGE in .env and run docker compose up -d. Your data is kept. The server brings its own database tables up to date when it starts.

A machine with no outside connection

Fetch the images on a machine that can reach the registry, save them to a file, and carry it across:

docker save <server image> <viewer image> caddy:2 | gzip > governate-images.tar.gz
gunzip -c governate-images.tar.gz | docker load
sudo ./install.sh

The installer uses images that are already on the machine. Without an outside connection the bundled proxy cannot obtain public certificates: use your own proxy and certificates, as below.

Your own proxy

Remove the proxy service from compose.yaml and forward the two addresses yourself: the main address to the server on port 8080, the viewer's address to the viewer on port 9980. The viewer uses WebSockets; your proxy must pass them through.

Without Docker

The server is also a single program with no dependencies. Quick start shows it run directly; a service manager such as systemd can keep it running. The document viewer is only supplied as a container.

Backing up

Back up the governate_data volume, or wherever you moved its contents. See Databases and Keys.