Skip to content
Jonath-zPublic

About

A visual control plane for deploying and managing applications on your own infrastructure, powered by Kamal.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Ship

Your servers. Your apps. One simple control plane.

Ship is a self-hosted visual control plane for Kamal. Ship owns desired infrastructure state; Kamal is the deployment engine beneath it. Application repositories are never modified and do not need a config/deploy.yml.

Repository: https://github.com/Jonath-z/ship

Prerequisites

  • Docker with Compose v2 (recommended local workflow)
  • Go 1.26+, Node 20+, and pnpm 9.12 when running services on the host

Run the complete local stack

cp .env.example .env
make dev

make dev builds and starts Redis, the Go API, the Go worker, and the Next.js dev server (next dev proxies /api to the Go API). Desired state lives in a SQLite database file under SHIP_DATA_DIR—there is no database container. Go services reload through Air and Next.js watches the web workspace. Once healthy, open:

Use the development first-run token shown in .env.example to create the local owner. The setup form signs that owner in immediately. Future visits use http://localhost:3000/login.

In another terminal, add the idempotent demo project fixture:

make seed

This creates a Demo Project and its Production environment. It deliberately does not insert an account or password directly into the database; accounts go through the same Argon2id setup and user-management paths used in production.

Use make dev-up to start in the background and make down to stop containers. The SQLite database file is preserved by both commands.

Install Ship on a VPS

Tagged releases are installed with:

curl -fsSL https://raw.githubusercontent.com/Jonath-z/ship/main/infra/installer/install.sh | sudo bash

The installer detects the public IPv4 address and prints the dashboard URL as http://SERVER_IP:3000. It supports Ubuntu 22.04/24.04 and Debian 12 on amd64 and arm64.

Ship installs exactly three containers: API, worker, and Redis. The API container serves both the dashboard and the HTTP API (under /api) on one public port — SHIP_PORT, default 3000 — while Redis stays on an internal Docker network. All desired state lives in a SQLite database file at /opt/ship/db/ship.db on the host, bind-mounted into the API and worker containers. Ship does not install or manage a reverse proxy or TLS certificates. Operators who need HTTPS can place their existing proxy, tunnel, or private network in front of port 3000.

The final installer output includes a one-time token. Open the printed http://HOST:3000/setup URL to create the owner account. The endpoint disables itself permanently after the first owner is saved.

Common host operations are:

ship status
ship logs
ship upgrade v0.2.0
ship backup
ship restore /path/to/ship-backup.tar.gz
ship public-url https://ship.example.com

After placing an external HTTPS proxy or tunnel in front of Ship, use ship public-url to set its exact browser-visible origin. This enables secure __Host- cookies, HSTS, and forwarded client-IP handling. Ship itself does not install Caddy or another proxy.

ship backup takes an online snapshot of the SQLite database (via VACUUM INTO) directly on the host; archives contain the database snapshot, the master encryption key, and the session secret, so they have mode 0600 and must be stored securely. ship restore stops the API and worker containers and swaps the database file back into place.

Run workspaces on the host

Install dependencies once:

pnpm install
go mod download

Start only the dependencies, apply migrations, and run each process in its own terminal:

make up
make migrate
make api       # http://localhost:8080
make worker    # health at http://localhost:8081
make web       # http://localhost:3000

The API can apply the schema during startup when SHIP_RUN_MIGRATIONS=true. make migrate creates or updates it; make migrate-down removes it. The schema is generated by GORM from the Go structs in server/migrations—there is no handwritten migration SQL.

The dashboard refreshes live status every ten seconds. It shows the API, worker, database, and Redis state together with the machine resources visible to the API container. Connection URLs and encryption/session secrets are never included in the system-status response.

Local accounts use Argon2id password hashes and opaque Redis-backed sessions. The owner manages accounts and roles from Settings; role changes, password changes, and disabled accounts invalidate existing sessions. Settings also contains the filtered, append-only audit log. See docs/security.md for the transport, CSRF, access-control, encryption, and SSH-command invariants.

Workspaces

Workspace Purpose Local command
apps/web Next.js dashboard (static export served by the API in production) make web
server/cmd/api HTTP API and OpenAPI contract make api
server/cmd/worker asynchronous worker and health server make worker
server/cmd/ship host CLI shipped in release bundles go build ./server/cmd/ship
packages/api-client typed HTTP client and generated types pnpm --filter @ship/api-client typecheck

The repository has one root Go module so go build ./... and go test ./... cover every backend package. go.work pins that module as the root workspace. pnpm discovers apps/* and packages/* through pnpm-workspace.yaml.

Generate and verify

pnpm generate        # OpenAPI -> TypeScript schema and client types
make lint
make test
make build

CI performs the same checks, tests migration up/down against SQLite, rejects stale generated files, checks installer idempotency and the three-service Compose contract, and builds both production container images. A vX.Y.Z tag publishes amd64/arm64 GHCR images plus checksummed installer bundles.

Layout

apps/web/      Next.js dashboard (static export)
server/        Go API, worker, shared domain and platform packages, migrations
packages/      Shared TypeScript types, API client, and UI primitives
infra/         Development/production Compose and Dockerfiles
docs/          Architecture, API, and operational documentation
scripts/       Code generation, seeding, and maintenance commands

See the folder guide and API conventions for the dependency boundaries and repository rules.

Architectural rules

  1. Ship owns desired state; Kamal turns it into running infrastructure.
  2. The UI mutates the model; only internal/configuration renders configuration.
  3. No Kamal commands exist outside internal/kamal.
  4. packages/api-client contains transport only.
  5. Desired state lives in SQLite, never Redis.
  6. Ship never modifies an application repository.
  7. Deployments are asynchronous; HTTP requests never wait for Kamal.

About

A visual control plane for deploying and managing applications on your own infrastructure, powered by Kamal.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages