Skip to main content

Portainer Deployment

Deploy and manage OpenLift using Portainer's intuitive web interface for Docker container management. Perfect for users who prefer GUI-based deployment and monitoring.

Note: OpenLift container images are not yet published. To avoid implying availability, image references in stack examples are commented as placeholders. Replace them with your own images when ready.

Prerequisites

System Requirements

  • Docker Engine (20.10.0+ recommended)
  • Portainer CE or EE installed and running
  • Docker Compose support enabled in Portainer
  • Sufficient resources: 4 CPU cores, 8GB RAM, 100GB storage

Portainer Setup

If you don't have Portainer installed:

# Create Portainer volume
docker volume create portainer_data

# Run Portainer
docker run -d -p 8000:8000 -p 9443:9443 \
--name portainer --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:latest

Access Portainer at: https://localhost:9443

Quick Deployment via Portainer

  1. Login to Portainer and navigate to "App Templates"
  2. Search for OpenLift in the template library
  3. Click Deploy and configure:
    • Application Name: openlift
    • Domain: Your domain (e.g., openlift.yourdomain.com)
    • JWT Secret: Generate a secure secret
    • Admin Email: Your email for initial admin user
  4. Deploy and wait for all services to start

Method 2: Custom Docker Compose

  1. Navigate to "Stacks" in Portainer
  2. Click "Add Stack"
  3. Name the stack: openlift
  4. Paste the Docker Compose content (see below)
  5. Configure environment variables
  6. Deploy the stack

Docker Compose Configuration for Portainer

Complete Stack Configuration

version: '3.8'

services:
openlift:
# image: <to-be-published>
container_name: openlift_app
restart: unless-stopped
ports:
- "${OPENLIFT_PORT:-3000}:3000"
environment:
- NODE_ENV=production
- PORT=3000
- DATABASE_URL=mongodb://mongodb:27017/openlift
- REDIS_URL=redis://redis:6379
- MINIO_ENDPOINT=http://minio:9000
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_BUCKET_NAME=openlift
- JWT_SECRET=${JWT_SECRET}
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost:3000}
- SMTP_HOST=${SMTP_HOST}
- SMTP_PORT=${SMTP_PORT:-587}
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- EMAIL_FROM=${EMAIL_FROM}
depends_on:
- mongodb
- redis
- minio
networks:
- openlift-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
labels:
- "traefik.enable=true"
- "traefik.http.routers.openlift.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.openlift.tls=true"
- "traefik.http.routers.openlift.tls.certresolver=letsencrypt"

mongodb:
# image: <set-your-image>
container_name: openlift_mongodb
restart: unless-stopped
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=openlift
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
networks:
- openlift-network
ports:
- "${MONGODB_PORT:-27017}:27017"
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s

redis:
# image: <set-your-image>
container_name: openlift_redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
networks:
- openlift-network
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5

minio:
# image: <set-your-image>
container_name: openlift_minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY:-minioadmin}
volumes:
- minio_data:/data
networks:
- openlift-network
ports:
- "${MINIO_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3

# Optional: Nginx reverse proxy
nginx:
# image: <set-your-image>
container_name: openlift_nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- nginx_certs:/etc/nginx/certs
- nginx_logs:/var/log/nginx
depends_on:
- openlift
networks:
- openlift-network
labels:
- "traefik.enable=false"

networks:
openlift-network:
driver: bridge

volumes:
mongodb_data:
driver: local
mongodb_config:
driver: local
redis_data:
driver: local
minio_data:
driver: local
nginx_certs:
driver: local
nginx_logs:
driver: local

Environment Variables Configuration

In Portainer's stack editor, add these environment variables:

# Application Configuration
JWT_SECRET=your-super-secure-jwt-secret-here
CORS_ORIGIN=https://openlift.yourdomain.com
DOMAIN=openlift.yourdomain.com

# Database Configuration
MONGODB_ROOT_PASSWORD=secure-mongodb-password
REDIS_PASSWORD=secure-redis-password

# MinIO Configuration
MINIO_ACCESS_KEY=openlift-access-key
MINIO_SECRET_KEY=secure-minio-secret-key

# Email Configuration (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
EMAIL_FROM=noreply@yourdomain.com

# Port Configuration
OPENLIFT_PORT=3000
MONGODB_PORT=27017
REDIS_PORT=6379
MINIO_PORT=9000
MINIO_CONSOLE_PORT=9001

Deployment Steps in Portainer

Step 1: Create the Stack

  1. Login to Portainer
  2. Select your Docker environment
  3. Navigate to StacksAdd Stack
  4. Name: openlift
  5. Build method: Web editor

Step 2: Configure the Stack

  1. Paste the Docker Compose configuration above
  2. Add Environment Variables using the variables section or .env file
  3. Enable access control if using Portainer Business Edition
  4. Review configuration for any needed adjustments

Step 3: Deploy and Monitor

  1. Click "Deploy the stack"
  2. Monitor deployment in the stack details view
  3. Check container logs for any issues
  4. Verify health checks are passing

Step 4: Access OpenLift

  1. Wait for all services to be running and healthy
  2. Access OpenLift at http://localhost:3000 (or your configured domain)
  3. Complete initial setup through the web interface
  4. Create admin account and configure application settings

Management via Portainer

Container Management

  • View container status and resource usage
  • Access container logs in real-time
  • Execute commands in containers via web terminal
  • Restart containers individually or as a group
  • Update container images with rolling restarts

Volume Management

  • Backup volumes using Portainer's backup features
  • Browse volume contents using the file manager
  • Monitor volume usage and space consumption
  • Create volume snapshots (if supported by storage driver)

Network Configuration

  • View network topology and container connections
  • Configure port mappings and service discovery
  • Monitor network traffic and connection health
  • Add additional networks for isolation

Resource Monitoring

  • Real-time metrics for CPU, memory, and network usage
  • Container performance graphs and statistics
  • Resource alerts and threshold notifications
  • Historical data for capacity planning

Advanced Configuration

SSL/TLS with Traefik

Add Traefik for automatic SSL certificates:

  traefik:
# image: <set-your-image>
container_name: traefik
restart: unless-stopped
command:
- --api.dashboard=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker=true
- --certificatesresolvers.letsencrypt.acme.tlschallenge=true
- --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik_letsencrypt:/letsencrypt
networks:
- openlift-network

Database Backup Automation

Add automated backup container:

  backup:
# image: <set-your-image>
container_name: openlift_backup
restart: unless-stopped
command: |
sh -c '
apk add --no-cache mongodb-tools curl
while true; do
sleep 86400 # 24 hours
mongodump --host mongodb:27017 --out /backup/$(date +%Y%m%d_%H%M%S)
find /backup -type d -mtime +7 -exec rm -rf {} +
done
'
volumes:
- backup_data:/backup
- mongodb_data:/data/db:ro
depends_on:
- mongodb
networks:
- openlift-network

Monitoring with Prometheus

Add monitoring stack:

  prometheus:
# image: <set-your-image>
container_name: prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
networks:
- openlift-network

grafana:
# image: <set-your-image>
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana_data:/var/lib/grafana
ports:
- "3001:3000"
networks:
- openlift-network

Troubleshooting in Portainer

Common Issues and Solutions

Container Won't Start

  1. Check container logs in Portainer's log viewer
  2. Verify environment variables are correctly set
  3. Check resource constraints and available system resources
  4. Validate network connectivity between containers

Database Connection Issues

  1. Verify MongoDB container is running and healthy
  2. Check database credentials in environment variables
  3. Test network connectivity using Portainer's console
  4. Review MongoDB logs for authentication errors

File Upload Problems

  1. Check MinIO container status and health
  2. Verify MinIO credentials and bucket configuration
  3. Test MinIO console access at the configured port
  4. Check volume mounts and permissions

Performance Monitoring

  • Resource usage graphs in container details
  • Health check status and failure history
  • Network traffic monitoring between services
  • Volume usage tracking and growth trends

Backup and Recovery

  • Use Portainer's backup feature for volume snapshots
  • Export stack configuration for disaster recovery
  • Regular container image updates via Portainer
  • Database backup monitoring through container logs

Security Considerations

  • Use secure passwords for all services
  • Enable Portainer access controls and user management
  • Regular security updates through Portainer's image management
  • Network isolation using Docker networks
  • SSL/TLS encryption for external access
  • Regular backup verification and restore testing

Portainer provides an excellent web-based interface for deploying and managing OpenLift, making container management accessible without command-line expertise while maintaining full control over your deployment.