Docker & compose
Prerequisites
- Docker and Docker Compose
- A
.envfile configured with all required environment variables — see Configuration
1. Create a directory for your deployment
bash
mkdir my-links-deployment
cd my-links-deployment2. Create a docker-compose.yml
yaml
name: my-links
services:
postgres:
container_name: postgres
image: postgres:18
restart: always
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
healthcheck:
test: ['CMD-SHELL', 'pg_isready', '-U', '${DB_USER}']
volumes:
- postgres-volume:/var/lib/postgresql
ports:
- '${DB_PORT}:5432'
my-links:
container_name: my-links
image: sonny93/my-links:latest
restart: always
environment:
- DB_HOST=postgres
- HOST=0.0.0.0
- NODE_ENV=production
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
ports:
- ${PORT}:3333
volumes:
postgres-volume:3. Create your .env
Use .env.example from the repository as a template, and see Configuration for what each variable does.
4. Start it
bash
docker compose up -dThis pulls the image from Docker Hub, starts PostgreSQL, applies database migrations automatically, and starts the application in production mode — reachable on the port set in PORT (default 3333).
Native deployment
If you would rather run it without Docker:
Node.js 24.14.0 (or compatible), pnpm, and PostgreSQL 18 installed and running.
Clone and install:
bashgit clone https://github.com/my-links/my-links.git cd my-links pnpm installCopy
.env.exampleto.envand configure it:bashcp apps/webapp/.env.example apps/webapp/.envPoint
DB_*at your PostgreSQL instance, then apply migrations (everynode acecommand runs fromapps/webapp):bashcd apps/webapp node ace migration:runCompile the translation catalogs and build:
bashpnpm run compile node ace buildCopy
.envinto the build output and start it:bashcp .env build/ cd build pnpm run start
The application is reachable on the port set in PORT.