Skip to content

Server lifecycle ​

The dopbase server commands manage the self-hosted HTTP server, REST API, SQLite storage, and Admin UI.

Automatic first startup ​

bash
dopbase server start

On fresh storage, startup creates the database, master key, and configuration examples, then prints the existing protected web setup link. Open it to create root or restore a backup. The server keeps running after setup. An initialized instance starts normally without changing its accounts or credentials.

To create root without opening a browser, supply an email:

bash
DOPBASE_ROOT_EMAIL=admin@dopbase.com dopbase server start

Dopbase generates a password, displays it once, and continues serving. Save the password, then sign in through the Admin UI or dopbase login. Account creation does not sign you in. Existing instances ignore this input, including invalid values. Missing or blank values select web setup on fresh storage; invalid nonblank values fail before creating files.

Automatic setup respects --no-web-ui, DOPBASE_WEB_UI=false, and web_ui = false. With the UI disabled, supply DOPBASE_ROOT_EMAIL or complete explicit CLI setup first. A pending factory reset still requires explicit setup; automatic startup does not finish an interrupted reset. Storage and master-key errors never fall back to setup.

Explicit setup remains available when you want terminal prompts, standalone provisioning, or the web flow with an email prefilled.

The generated password is part of the startup output, so Docker, systemd, redirected files, or CI logs may retain it.

If credential delivery fails after account creation, Dopbase stops the new server and reports that initialization committed. Recover with dopbase admin reset-password EMAIL using the same instance options; another start will not generate replacement credentials.

--json cannot be used with dopbase server start.

See server setup for the unchanged explicit setup commands.

Configuration files ​

CLI setup creates missing configuration files before creating root. Automatic startup and web setup create missing references after the listener binds:

  • ~/.dopbase/server.toml describes every server setting, including defaults, examples, accepted values, and environment overrides.
  • ~/.dopbase/config.toml describes client connection and default environment settings.

All generated settings and table headers are commented out. Uncomment the settings you need, including the table header for nested settings. Restart the server after changing server.toml.

Setup and startup leave existing files untouched. CLI options and environment variables apply to the current run and are not saved into the examples. --data-dir or DOPBASE_DATA_DIR relocates both files; --config <FILE> selects a different server config path while the client config stays in the data directory.

Disable the web UI ​

The web UI is enabled by default. To use only the CLI and REST API, set this in server.toml:

toml
web_ui = false

You can also disable it for a server run:

bash
DOPBASE_WEB_UI=false dopbase server start
dopbase server start --no-web-ui

Priority is --no-web-ui, then DOPBASE_WEB_UI, then web_ui in server.toml, then the default true. File and environment values accept true or false. Restart after changing the saved setting.

When disabled, UI pages and bundled assets return a JSON 404 response. The CLI and REST API remain available. Swagger and OpenAPI still use the separate docs setting. Startup displays Admin UI: disabled.

server setup --web explicitly enables the UI for that entire run, including after setup finishes. It leaves the saved setting unchanged; the next normal start follows configuration.

Start the server ​

bash
dopbase server start

The server runs in the terminal until you press Ctrl+C or send it SIGTERM. Its log goes to that terminal.

The default listener is 127.0.0.1:8840. Change the host or port separately:

bash
dopbase server start --port 9000
dopbase server start --host 0.0.0.0
dopbase server start \
  --host 0.0.0.0 \
  --public-url https://dopbase.example.com

When the server binds to a non-loopback address without a public URL, Dopbase shows http://SERVER_HOST:<port>. Replace SERVER_HOST with the server's public IP address or domain. Dopbase does not inspect network routes or call an external service to discover the address.

Set the public URL to make generated links ready to use:

bash
dopbase server start \
  --host 0.0.0.0 \
  --public-url http://203.0.113.10:8840
dopbase server start --public-url https://dopbase.example.com
export DOPBASE_PUBLIC_URL=https://dopbase.example.com

You can also set public_url = "https://dopbase.example.com" in server.toml. Public URLs may use an IP address or domain. Dopbase warns when a remote URL uses HTTP because credentials, secrets, and setup tokens are not encrypted. Use HTTPS for deployments. Dopbase never derives its public URL from request headers.

start accepts these options:

OptionPurpose
--config <FILE>Read a different server.toml file
--host <HOST>Bind to an IP address, default 127.0.0.1
--port <PORT>Listen on a port, default 8840
--public-url <URL>Set the URL clients use to reach the server
--shutdown-grace-seconds <SECONDS>Set the request-drain timeout
--no-web-uiDisable the web UI for this run
--docsEnable Swagger UI and the OpenAPI document
--no-docsDisable API documentation for this run
--master-key-file <FILE>Read the server master key from another file

Only one server can use a data directory at a time.

Keep the server running ​

Let Docker or a service manager such as systemd run dopbase server start for you. The server writes its log to stdout and stderr, so you read it with docker logs or journalctl.

Docker ​

The dopbase/dopbase image runs dopbase server start as its default command. Start the container with --restart unless-stopped and Docker brings the server back after a crash or a reboot. The image page on Docker Hub has the full docker run and Compose examples.

bash
docker logs -f dopbase
docker restart dopbase
docker stop dopbase

docker stop kills a container that is still running after 10 seconds, which is also the default shutdown_grace_seconds. Give the container a few seconds more, with --stop-timeout 15 on docker run or stop_grace_period: 15s in Compose, so the server can close its database after it stops waiting for open requests.

systemd ​

Save this unit as /etc/systemd/system/dopbase.service:

ini
[Unit]
Description=Dopbase server
After=network-online.target
Wants=network-online.target

[Service]
User=dopbase
Environment=DOPBASE_DATA_DIR=/srv/dopbase
ExecStart=/usr/local/bin/dopbase server start
Restart=on-failure
TimeoutStopSec=30

[Install]
WantedBy=multi-user.target

The unit expects a dopbase user that owns /srv/dopbase, and the binary at /usr/local/bin/dopbase. The install script uses ~/.local/bin unless you set DOPBASE_INSTALL_DIR. Keep TimeoutStopSec longer than shutdown_grace_seconds, which defaults to 10, so systemd lets the server finish draining requests.

bash
sudo systemctl daemon-reload
sudo systemctl enable --now dopbase
journalctl -u dopbase -f

On fresh storage, the setup link or the generated root password appears in that log.

Check status ​

server status prints whether a server is running from the data directory selected by --data-dir:

bash
dopbase server status
dopbase --data-dir /srv/dopbase server status
text
Server:     running
Data:       /srv/dopbase

A stopped server prints Server: stopped with the same Data line. The command exits with status 0 when the server is running and 1 when it is stopped.

With --json:

json
{
  "data_dir": "/srv/dopbase",
  "mode": "foreground",
  "status": "running"
}

When the server is stopped, status is "stopped" and mode is null.

Use dopbase client status to inspect the active client endpoint, login, and default environment. dopbase status is an alias for that client command.

Removed commands ​

Dopbase no longer runs the server in the background. These commands were removed with it:

Removed commandUse instead
dopbase server start --background or -bdopbase server start under Docker or systemd
dopbase server updopbase server start under Docker or systemd
dopbase server stopCtrl+C in the server's terminal, docker stop, or systemctl stop
dopbase server downCtrl+C in the server's terminal, docker stop, or systemctl stop
dopbase server restartStop the server and start it again, docker restart, or systemctl restart
dopbase server logsThe server's terminal, docker logs, or journalctl

Each one still prints a notice that says what to do instead, then exits with status 1 without starting or stopping a server. With --json, the notice is a payload on stdout with success = false and an info.code of COMMAND_REMOVED or COMMAND_REPLACED. Update scripts that call them.

Upgrading with a background server still running ​

If a background server started by 0.2.1 or earlier is still running, stop it with the old binary before you upgrade:

bash
dopbase server stop

If you already upgraded, dopbase server status shows that server with its PID, and kill <pid> stops it. dopbase server start also names the PID when it refuses to start. You can delete the leftover dopbase.pid and serve.log files in the data directory afterwards.

Storage and configuration ​

Runtime files live in ~/.dopbase by default. Select another directory with the global --data-dir <DIR> option or DOPBASE_DATA_DIR.

The database location is fixed:

text
<data-dir>/dopbase.db

database_url, DOPBASE_DATABASE_URL, and --database-url are ignored. If an older installation points to another SQLite file, stop the server and move that file to <data-dir>/dopbase.db before upgrading.

Configure the listener with host and port. The old bind_address, DOPBASE_BIND_ADDRESS, and --bind-address settings are ignored.

toml
version = 1
host = "127.0.0.1"
port = 8840
web_ui = true
docs = false

API documentation ​

Swagger UI and the OpenAPI document are disabled by default. Enable them for one run with:

bash
dopbase server start --docs

You can also set docs = true in server.toml or DOPBASE_DOCS=true.

Migrations run before HTTP requests are served. Setup and automatic startup create a random master key with owner-only permissions for new installations. During shutdown, Dopbase stops new requests, drains active requests, checkpoints SQLite, and closes the database.

Open-source secrets management for developers.