Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ or you can run in background
nohup openviking-server > /data/log/openviking.log 2>&1 &
```

For long-running environments, prefer a `systemd --user` service instead of `nohup` so restarts and process state are managed consistently. See: [Server Mode (systemd user service)](./docs/en/getting-started/03-quickstart-server.md#run-with-systemd-user-service-recommended-for-linux).

#### Run the CLI

```bash
Expand Down
31 changes: 31 additions & 0 deletions docs/en/getting-started/03-quickstart-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,37 @@ You should see:
INFO: Uvicorn running on http://0.0.0.0:1933
```

## Run with systemd user service (recommended for Linux)

`openviking-server` runs in the foreground. For persistent Linux sessions, use a user-level systemd unit instead of shell background wrappers.

1. Copy the example unit file:

```bash
mkdir -p ~/.config/systemd/user
cp docs/en/getting-started/examples/openviking-server.service ~/.config/systemd/user/openviking.service
```

2. Edit the unit values:

- Set `WorkingDirectory` to your OpenViking workspace
- Set `Environment=OPENVIKING_CONFIG_FILE=...` to your `ov.conf` path
- Optionally add `Environment=OPENVIKING_CLI_CONFIG_FILE=...` if needed

3. Enable and start:

```bash
systemctl --user daemon-reload
systemctl --user enable --now openviking.service
systemctl --user status openviking.service
```

4. View logs:

```bash
journalctl --user -u openviking.service -f
```

## Verify

```bash
Expand Down
15 changes: 15 additions & 0 deletions docs/en/getting-started/examples/openviking-server.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=OpenViking Server (user service)
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=%h/openviking
Environment=OPENVIKING_CONFIG_FILE=%h/.openviking/ov.conf
ExecStart=/usr/bin/env openviking-server --config ${OPENVIKING_CONFIG_FILE}
Restart=on-failure
RestartSec=2

[Install]
WantedBy=default.target