# Server commands

Canonical: https://godspeedmissioncontrol.com/guide/server-commands

These commands are for a server installed with the one-line command, where Godspeed runs inside a Docker container. Log in to your server's terminal (your hosting company's control panel shows how) and work as root. Everyday use needs none of this: the notebook and Telegram cover it. A server without Docker, where you ran `install-godspeed.sh`, is [at the end](#a-server-without-docker).

## Open a terminal on the server

The installation's folder `/opt/godspeed-mission-control` is readable by root only. If you logged in as another user who may use `sudo`, become root first:

```bash
sudo -i
```

## Find the container

Go to the installation's folder, so every `docker compose` command finds it, and list its services:

```bash
cd /opt/godspeed-mission-control
docker compose ps
```

You see two services: `godspeed`, which is Godspeed itself, and `https`, which gives it its secure web address.

## Run a command inside

From `/opt/godspeed-mission-control`:

```bash
docker compose exec -u hermes godspeed <command>
```

`-u hermes` runs the command as the account your assistant uses. Use `bash` as the command to open a shell inside. Inside the container:

- `/opt/data/full-candidate/workspace` is your mission control folder.
- `/opt/data/full-candidate/media` holds your media, the pictures and files attached to notes.
- `/opt/data/full-candidate/hermes` is the home of Hermes, the program that runs your assistant, with its settings, routines and commands.
- `/opt/godspeed/kit` holds the product's own files.

All your data is in the Docker volume `godspeed-mission-control_godspeed-data`, which the container sees as `/opt/data/full-candidate`.

## See whether it runs

From `/opt/godspeed-mission-control`:

```bash
docker compose ps
docker compose logs godspeed
```

The installer's notes are in `/opt/godspeed-mission-control/install.log`.

The health address answers from anywhere, without a sign-in. Your address is on the line `GODSPEED_HOST=` in `/opt/godspeed-mission-control/.env`.

```bash
curl -fsS https://<your address>/health
```

A working server answers with a line that starts `{"ok":true`. More on [Check that it is running](/guide/check-it-works).

## Routines with hermes cron

Hermes keeps your routines. Inside the container it is `/opt/hermes/bin/hermes`, already pointed at them:

```bash
docker compose exec -u hermes godspeed /opt/hermes/bin/hermes cron list
```

- `cron list`: every routine, with its ID and next run.
- `cron pause <job id>` and `cron resume <job id>`: stop one and start it again.
- `cron run <job id>`: run one on the scheduler's next tick, within about a minute.
- `cron runs`: recent runs. `cron incidents`: failures, grouped.
- `cron status`: names the scheduler, the notebook (`godspeed_notebook`), and lists the active routines. It does not check that the notebook runs, but the health address does.

**Settings**, **Routines** in the notebook shows the same routines ([Pause, move or run a routine](/guide/routines)).

## Your mission control's commands inside

The `mc-` commands are in `/opt/data/full-candidate/hermes/bin`. Start them in your mission control folder with `-w`, so each one finds it:

```bash
docker compose exec -u hermes -w /opt/data/full-candidate/workspace godspeed /opt/data/full-candidate/hermes/bin/mc-due
```

[Terminal commands](/guide/terminal-commands) describes each one. The notebook's own program works the same way:

```bash
docker compose exec -u hermes godspeed node /opt/godspeed/kit/notebook/bin/godspeed.mjs validate
```

To save its output in a file on the server itself, add `-T`:

```bash
docker compose exec -T -u hermes godspeed node /opt/godspeed/kit/notebook/bin/godspeed.mjs export > notebook-export.json
```

More on [The notebook command](/guide/notebook-command).

## Update the server

Run the one-line install command again. It keeps your address, your account and all your data, and brings the server to the newest release. It saves no copy of your notebook first, so press **Save a backup** under **Settings**, **Recovery** in the notebook before you run it.

```bash
curl -fsSL https://godspeedmissioncontrol.com/server | bash
```

More on [Update Godspeed Mission Control](/guide/update).

> [!WARNING]
> `docker compose down -v` deletes all your data, because it removes the volumes. Use it only to remove Godspeed for good ([Uninstall Godspeed Mission Control](/guide/uninstall)).

## A server without Docker

Here the notebook runs as a service, with no container. The `mc-` commands and `hermes cron` work directly in the server's terminal, as on a [Linux computer](/guide/terminal-commands#mac-and-linux). These show what is wrong:

```bash
systemctl status godspeed-integrated-notebook.service
```

```bash
journalctl -u godspeed-integrated-notebook.service -n 50
```

```bash
journalctl -u godspeed-https.service -n 50
```

The first shows whether the notebook runs, and the second what it last said. The third shows what Caddy, the program behind its secure web address, last said. If the server ran its own Caddy before you installed, use `journalctl -u caddy -n 50` instead.

If you installed from an account without `sudo`, the notebook runs as your own user's service. Put `--user` after `systemctl` and after `journalctl` in the first two lines. The third does not apply, because such a server gets no secure web address.

Such a service stops when you log out, and your routines with it, unless the server is set to keep it running. To check, run this with your user name:

```bash
loginctl show-user <user> -p Linger --value
```

`no` means it stops at logout. To keep it running, ask whoever runs the server to run this once:

```bash
sudo loginctl enable-linger <user>
```

This kind of server has no Telegram: you talk to Godspeed in the notebook.
