Self Hosting
Deploy S3 Portal with Docker and configure the required environment variables.
On this page
Prerequisites
- Docker installed on your machine. Install Docker
- A domain or server (optional, for production).
Step 1 - Download
Download compose file
curl -LO https://github.com/mayurG2299/s3-portal/raw/master/docker-compose.production.yml
curl -LO https://github.com/mayurG2299/s3-portal/raw/master/.env.example
Step 2 - Create .env
Create env file
cp .env.example .env
Step 3 - Generate keys
Generate and write secrets
NEXTAUTH_SECRET=$(openssl rand -base64 32)
ENCRYPTION_KEY=$(openssl rand -base64 32 | cut -c1-32)
sed -i.bak "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET=\"$NEXTAUTH_SECRET\"|" .env
sed -i.bak "s|^ENCRYPTION_KEY=.*|ENCRYPTION_KEY=\"$ENCRYPTION_KEY\"|" .env
rm -f .env.bak
Step 4 - Configure values
Edit env file
nano .env
| Variable | Required | Description |
|---|---|---|
DB_PASSWORD | required | Strong PostgreSQL password |
NEXTAUTH_SECRET | required | openssl rand -base64 32 |
ENCRYPTION_KEY | required | openssl rand -base64 32 |
NEXTAUTH_URL | required | e.g. http://localhost:3000 |
NEXT_PUBLIC_APP_URL | required | Same as NEXTAUTH_URL |
DOCKER_USER | required | Docker Hub org/user, e.g. may99 |
PORT | optional | Default: 3000 |
LOG_LEVEL | optional | Default: INFO |
Step 5 - Start
Start services
docker compose -f docker-compose.production.yml up -d
Step 6 - Run migrations (first time only)
Run migrations
docker compose -f docker-compose.production.yml run --rm app npx prisma db seed
Step 7 - Connect AWS
- Visit
http://localhost:3000. - Follow the onboarding wizard.
- AWS credentials setup guide ->
Useful commands
Operations
# View logs
docker compose -f docker-compose.production.yml logs -f
# Stop
docker compose -f docker-compose.production.yml down
# Update to latest
docker compose -f docker-compose.production.yml pull && docker compose -f docker-compose.production.yml up -d
Updating
Update
docker compose -f docker-compose.production.yml pull
docker compose -f docker-compose.production.yml up -d