Running a server

What to look at, what to set up in the first week, and what to do as it grows.

On this page

Moorage asks little of whoever runs it. This page says what to set up in the first week, what to look at after that, and what changes as a server grows. Installing Moorage comes first.

The first week#

  1. Check it. moor server doctor looks at the server and what it depends on, and says how to fix what it finds.

    sudo moor server doctor
  2. Decide about TLS, if you have not. A public CA, or an intermediate from your company's, means nobody has to trust anything by hand.

  3. Keep apps apart. On a shared Linux server, run as root and use level = "user" or "sandbox" in [isolation]. moor server doctor and the System page say what you have. How apps are kept apart says what each gives you.

  4. Add people. Give most people a role in a project, and only a few the administrator's. Accounts and access says how, and How people sign in connects your identity provider.

  5. Back up. Set a schedule in Settings → Backups, and keep keys/master.key somewhere apart: without it, the secrets in a backup cannot be read, and with it, anyone can. Then try a restore. See Backups.

  6. Be told. Add a channel and a rule in Settings → Notifications, so that a failed deployment, a crash loop, a failed cron job, a full disk or a failed backup reaches someone. See Notifications.

  7. Close the ports you do not use. Moorage needs its HTTP and HTTPS ports, and the SSH port if you push over SSH. Apps are told to listen on loopback, and moor server doctor warns of one that can be reached another way.

What to look at#

The console's Settings → System has what the server runs, and what the checks find:

The System page: all is well, what the server runs, and each check with how to fix itThe System page: all is well, what the server runs, and each check with how to fix it
Settings → System: the same checks as moor server doctor.

From the command line:

moor server status
sudo moor server doctor
moor events -f

Who did what is in the audit log, for a year: each change, sign-in, secret revealed and git push, with who and how it went, and where from for all but pushes. Settings → Audit log searches and downloads it, and moor audit shows it.

The audit log: when, who, what, to what, how it went, and from whereThe audit log: when, who, what, to what, how it went, and from where
Settings → Audit log.

How it is doing is in metrics, for Prometheus as well as the console, and can go on to an OpenTelemetry collector.

The server's health answers at /.moorage/health on every hostname, for whatever watches your machines.

Where the disk goes#

Everything is under the data directory, in plain files you can look at:

FolderWhat it holdsWhat limits it
moorage.dbThe databaseGrows slowly. Events go after 90 days, the audit log after a year
reposApps' git repositoriesThe size of their history
buildsBuilds, and uploads for redeployingkeep_releases in each manifest: five by default
dataApps' own dataThe apps. Moorage keeps nothing of its own here
logsApps', deployments' and the server's logsRotation at 10 MiB, five files back, and 14 days for stopped instances. Deployments' logs stay until their app or environment goes
toolchains, cacheToolchains and build cachesOne copy of each version, shared by every app
backupsDatabase copies before each migration, and backups if you send them thereThe last three migrations; your schedule's keep
keys, certsThe master key, SSH host keys and the CASmall. Back up keys apart

moor server doctor looks at free space, and a server tells those concerned when the data volume passes disk_percent in [notifications], 90% by default.

Deleting an app removes its builds, logs and repository, and its data unless you keep it. Previews remove themselves when their branch goes, or after seven days unused.

As it grows#

Stopping and restarting#

Apps do not depend on the server being up. Stopping, restarting or upgrading it leaves them running and serving what is in flight, and it takes them over again when it starts.

sudo moor server restart
sudo moor server stop

To stop the apps and their services too, whether or not the server is running:

sudo moor server stop --all

When something is wrong has more on that.

Upgrading#

sudo moor server upgrade

It checks what it downloads, keeps a copy of the database and of the binary, and goes back by itself if the new version does not come up. See Upgrading.

A checklist for a shared server#

Security says what these protect against, and what they do not.

Suggest a change to this page