Docker and Docker Compose
Requirements: a Linux server with Docker and Docker Compose and, for online booking, a domain pointing to it.
Try it locally
Section titled “Try it locally”The compose.yaml file at the repository root builds the image from source and starts an instance in development
mode with Mailpit to read outgoing mail. Do not use it in production.
git clone https://github.com/coste360/porto.git && cd portoPORTO_BOOTSTRAP_OWNER_EMAIL=owner@porto.test PORTO_BOOTSTRAP_OWNER_NAME="Mario Rossi" \PORTO_BOOTSTRAP_OWNER_ORG="Test Marina Ltd" PORTO_ADMIN_PASSWORD=test-password-123 \ docker compose up --build # or: make upOpen http://localhost:8080/admin/ and sign in with those credentials (password of at least 12 characters); mail is
at http://localhost:8025. To load the demo marina: docker compose exec porto /porto seed demo
(Demo data).
Installing on a server
Section titled “Installing on a server”The production files are in deploy/: docker-compose.yml (SQLite in the porto-data volume) and
docker-compose.postgres.yml (PostgreSQL 17). The container runs as a non-root user with a read-only file system and
no capabilities.
-
Configuration. Start from
.env.exampleand createdeploy/.env:Finestra del terminale git clone https://github.com/coste360/porto.git && cd portocat > deploy/.env <<ENDPORTO_BASE_URL=https://porto.my-marina.examplePORTO_SECRET_KEY=$(openssl rand -base64 32)PORTO_SMTP_URL=PORTO_BOOTSTRAP_OWNER_EMAIL=owner@my-marina.examplePORTO_BOOTSTRAP_OWNER_NAME=Mario RossiPORTO_BOOTSTRAP_OWNER_ORG=Example Marina LtdPORTO_ADMIN_PASSWORD=choose-a-long-passwordENDThe variables are described in Configuration.
-
Image. Once the image is published the compose file pulls it (
PORTO_VERSION, defaultlatest). Until then, build it on the server and set the tag:Finestra del terminale docker build -f deploy/Dockerfile -t ghcr.io/coste360/porto:dev . # or: make dockerecho "PORTO_VERSION=dev" >> deploy/.env -
Start.
Finestra del terminale docker compose -f deploy/docker-compose.yml up -d -
First sign-in at
https://porto.my-marina.example/admin/: see First start.
With PostgreSQL
Section titled “With PostgreSQL”Add POSTGRES_PASSWORD to deploy/.env and use the other file:
echo "POSTGRES_PASSWORD=$(openssl rand -hex 24)" >> deploy/.envdocker compose -f deploy/docker-compose.postgres.yml up -dThe compose file puts the password into DATABASE_URL without encoding it: use URL-safe characters only, like those
of openssl rand -hex. See Database.
Binary commands in the container
Section titled “Binary commands in the container”The image is distroless and has no shell, but exec runs the binary directly:
docker compose -f deploy/docker-compose.yml exec porto /porto versiondocker compose -f deploy/docker-compose.yml exec porto /porto migrate statusdocker compose -f deploy/docker-compose.yml exec porto /porto backup --out /data/backup.porto-backupPut Porto behind a reverse proxy or let it obtain Let’s Encrypt certificates itself: see
HTTPS and reverse proxy. Health checks are done from outside with
GET /healthz and GET /readyz (Monitoring and logs).
Porto is developed by Coste360 SRL. Source available under the BSL 1.1; the Porto trademark is not covered by the licence.