Quick start
This guide shows the shortest path from an existing Docker Compose project to a Tarsail deployment.
Use placeholders while learning. Do not commit real server addresses, private domains, credentials, or production .env contents to public repositories.
Requirements
Section titled “Requirements”Local machine:
- Docker;
- Docker Compose v2;
sshandscpwhen using key authentication;- Tarsail installed globally.
Remote server:
- Linux;
- SSH access;
- Docker;
- Docker Compose v2;
- permission to run Docker commands;
- a writable project path such as
/opt/my-app.
1. Install Tarsail
Section titled “1. Install Tarsail”PowerShell on Windows, macOS, or Linux:
irm https://tarsail.plystra.com/install.ps1 | iexPOSIX shell on Linux or macOS:
curl -fsSL https://tarsail.plystra.com/install.sh | shVerify:
tarsail versionFor custom install directories and pinned release IDs, read Install and upgrade.
2. Prepare Compose image tags
Section titled “2. Prepare Compose image tags”Every service must have an explicit image: value.
Good:
services: web: build: context: . dockerfile: Dockerfile image: my-app-web:${TARSAIL_RELEASE_ID:-local} ports: - "80:8080"Not supported:
services: web: build: .Tarsail discovers image names from docker compose config, saves those images locally, uploads them, and loads them on the server. Without explicit image tags, the release cannot be bundled reliably.
3. Initialize config
Section titled “3. Initialize config”From the root of your Compose project:
tarsail initThis creates tarsail.yml.
Edit it:
project: my-app
target: name: prod host: example.com user: deploy port: 22 path: /opt/my-app
compose: file: compose.yaml
deploy: keep_releases: 34. Add an env file when needed
Section titled “4. Add an env file when needed”If the remote Compose app needs runtime variables, store the real file outside version control, for example:
.deploy/prod.envExample contents:
APP_ENV=productionAPP_BASE_URL=https://app.example.comSESSION_SECRET=replace-with-a-long-random-valueAdd it to tarsail.yml:
compose: file: compose.yaml env_file: source: .deploy/prod.env target: shared/.env mode: 600Tarsail uploads this file into <target.path>/shared/.env during deploy, then passes it to remote Docker Compose.
5. Check readiness
Section titled “5. Check readiness”With the default SSH identity:
tarsail doctorWith a specific key:
tarsail --identity-file ~/.ssh/my-app-deploy-key doctorWith password authentication:
tarsail --ask-password doctorPassword mode prompts once for the remote user’s SSH password and reuses it for remote commands and uploads during that single Tarsail run.
6. Deploy
Section titled “6. Deploy”Key authentication:
tarsail --identity-file ~/.ssh/my-app-deploy-key deployPassword authentication:
tarsail --ask-password deployTarsail prints each major step and then shows remote Compose status.
7. Inspect the deployment
Section titled “7. Inspect the deployment”tarsail statustarsail logstarsail logs webFollow logs:
tarsail logs -f webLimit log output:
tarsail logs --tail 100 web8. Roll back if needed
Section titled “8. Roll back if needed”tarsail rollbackRollback reactivates the previous release’s Compose file and bundled images.
Rollback does not restore databases, Docker volumes, bind-mounted data, or external services.
9. Prune old releases
Section titled “9. Prune old releases”tarsail pruneNon-interactive:
tarsail prune --yesdeploy.keep_releases controls how many releases should remain when pruning.
A complete minimal example
Section titled “A complete minimal example”compose.yaml:
services: web: build: . image: my-app-web:${TARSAIL_RELEASE_ID:-local} environment: APP_ENV: ${APP_ENV:-production} APP_ADDR: ${APP_ADDR:-0.0.0.0:8080} SESSION_SECRET: ${SESSION_SECRET} ports: - "80:8080" restart: unless-stopped healthcheck: test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/healthz"] interval: 30s timeout: 5s retries: 3tarsail.yml:
project: my-app
target: name: prod host: example.com user: deploy port: 22 path: /opt/my-app
compose: file: compose.yaml env_file: source: .deploy/prod.env target: shared/.env mode: 600
deploy: keep_releases: 5Deploy:
tarsail --identity-file ~/.ssh/my-app-deploy-key deploy