Portabase Logo

CLI Reference

Master the Portabase command-line tool.

The Portabase CLI is the central orchestration tool. It acts as an intelligent wrapper on top of Docker Compose to:

  1. Generate valid and secure configurations.
  2. Manage the container lifecycle (start/stop/logs).
  3. Administer database connections without manually editing JSON files.

Installation

curl -sL https://portabase.io/install | bash

Check the installed version:

portabase --version

Component Initialization

These commands generate the folder structure, docker-compose.yml files, .env configurations, and security keys.

agent

Creates a new backup agent. The agent is the connector that installs on your database servers.

portabase agent [OPTIONS] NAME

Arguments

ArgumentRequiredDescription
NAMEYesThe name of the folder to create (e.g., prod-db-01).

Options

OptionAliasDescription
--key <str>-kThe Edge Key provided by the Dashboard. If omitted, it will be requested interactively.
--start-sStart the agent immediately after creation.

Interactive Assistant

If you simply run portabase agent my-agent, the CLI will launch an assistant to:

  1. Request the key.
  2. Offer to automatically add database containers (Postgres/MariaDB).

dashboard

Creates a Dashboard instance (the web management interface).

portabase dashboard [OPTIONS] NAME

Options

OptionAliasDescriptionDefault
--port <int>The web listening port for the interface.8887
--start-sStart the dashboard immediately after creation.False

Database Management (db)

The db module allows you to modify an agent's databases.json configuration without risk of syntax errors.

These commands modify the configuration. For them to take effect, you must restart the agent (portabase restart &lt;agent&gt;).

db list

Displays a summary table of databases configured for a given agent.

portabase db list <AGENT_PATH>

db add

Launches an interactive assistant to add a new connection to the configuration.

portabase db add <AGENT_PATH>

The assistant will ask you for:

  • Type: PostgreSQL, MySQL, MariaDB.
  • Host: The IP address or hostname (use localhost for a DB on the same server).
  • Port: The listening port (e.g., 5432).
  • Credentials: Username and password.

db remove

Removes a database from the configuration via an interactive selection menu.

portabase db remove <AGENT_PATH>

Lifecycle (Operations)

These commands replace direct use of docker compose. They must target the folder of a component (Agent or Dashboard).

Productivity Tip

If you are already in the component folder, you can use . as the path. Example: portabase logs .

start

Starts containers in detached mode (background). Equivalent to docker compose up -d.

portabase start <PATH>

stop

Stops containers cleanly.

portabase stop <PATH>

restart

Restarts all services. Useful after a configuration change (db add or modification in .env).

portabase restart <PATH>

logs

Displays container logs.

portabase logs [OPTIONS] <PATH>

Options

OptionAliasDescription
--follow / --no-follow-fFollows logs in real time (enabled by default). Press Ctrl+C to exit.

uninstall

Removes the entire deployment.

portabase uninstall [OPTIONS] <PATH>

Options

OptionAliasDescription
--force-fDoes not ask for confirmation before deleting.

This command performs a docker compose down -v. This removes containers AND data volumes (local databases, configurations). This action is irreversible.


Common Troubleshooting

On this page