Docker Installation
Install Journiv using Docker Compose for production-ready deployments with optional PostgreSQL.
Docker Compose is recommended for production deployments. It provides easy configuration management, allows you to run multiple services together, and simplifies updates and maintenance.
Installation
Create a directory
Create a directory for your Journiv installation:
mkdir journiv
cd journivDownload files
Download the SQLite docker-compose file and environment template:
curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/docker-compose.prod.sqlite.ymland environment template:
curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/env.templateAlternatively, download these files from your browser and move them to the directory you created.
Download the PostgreSQL docker-compose file
curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/docker-compose.prod.postgres.ymland environment template:
curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/env.templateAlternatively, download these files from your browser and move them to the directory you created.
Generate a secure SECRET_KEY
Before configuring your environment, generate a strong secret key:
# Using OpenSSL (recommended)
openssl rand -base64 32
# Or using Python
python -c "import secrets; print(secrets.token_urlsafe(32))"Important: Use a different SECRET_KEY for each instance. Never share your secret key or commit it to version control.
Configure environment
Rename the template file to .env:
mv .env.template .envEdit the .env file with your settings, using the SECRET_KEY you generated:
SECRET_KEY=your-generated-secret-key-here
DOMAIN_NAME=192.168.1.1
APP_VERSION=latestEdit the .env file with your settings, using the SECRET_KEY you generated:
SECRET_KEY=your-generated-secret-key-here
DOMAIN_NAME=192.168.1.1
APP_VERSION=latest
DB_DRIVER=postgres
# Preferred: POSTGRES_PASSWORD
POSTGRES_PASSWORD=your-secure-password
# OR: DATABASE_URL with a PostgreSQL URL (postgresql:// or postgres://)
DATABASE_URL=postgresql://user:password@host:5432/dbname
# Do not specify both POSTGRES_PASSWORD and DATABASE_URL. They are mutually exclusive.Choose a strong password for POSTGRES_PASSWORD.
Start the container
Start Journiv:
docker compose up -dAccess the application
Visit http://192.168.1.1:8000 (or your configured domain) to access Journiv.
Required Environment Variables
Two environment variables are required for Journiv to run:
| Variable | Description | Examples / Notes |
|---|---|---|
SECRET_KEY | A strong secret key for JWT token signing (minimum 32 characters) | Generate with: openssl rand -base64 32 or python -c "import secrets; print(secrets.token_urlsafe(32))" |
DOMAIN_NAME | Your server IP address or domain name | 192.168.1.1, journiv.example.com, localhost |
Complete list of environment variables can be found in the Environment Variables section.
Updating Journiv
To update to the latest version:
# Pull latest images
docker compose pull
# Restart services
docker compose up -dImportant: Always backup your data before updating. Database migrations run automatically on startup.
Backup and Restore
Backup
Full backup (database + media):
# Create backup archive
docker compose exec journiv tar czf /data/backup-$(date +%Y%m%d).tar.gz /data
# Copy backup to host
docker compose cp journiv:/data/backup-YYYYMMDD.tar.gz ./backup.tar.gzPostgreSQL backup:
# Backup PostgreSQL database
docker compose exec postgres pg_dump -U journiv journiv > backup.sqlRestore
From archive:
# Copy archive to container
docker compose cp ./backup.tar.gz journiv:/data/backup.tar.gz
# Extract archive
docker compose exec journiv tar xzf /data/backup.tar.gz -C /PostgreSQL restore:
# Restore PostgreSQL database
docker compose exec -T postgres psql -U journiv journiv < backup.sqlEnvironment Variables
Common environment variables for Docker Compose:
| Variable | Default | Description |
|---|---|---|
SECRET_KEY | - | Required - Secret key for JWT token signing (minimum 32 characters) |
DOMAIN_NAME | - | Required - Server IP address or domain name |
DATABASE_URL | sqlite:////data/journiv.db | Database connection string |
APP_VERSION | latest | Application version tag |
DOMAIN_SCHEME | http | Domain scheme (http, https) |
MAX_FILE_SIZE_MB | 50 | Maximum file upload size in MB |
IMPORT_EXPORT_MAX_FILE_SIZE_MB | 500 | Maximum import/export file size in MB |
DISABLE_SIGNUP | false | Disable new user registration |
MEDIA_ROOT | /data/media | Directory for uploaded media files |
EXPORT_DIR | /data/exports | Directory for exported data files |
See Environment Variables for complete reference.
Troubleshooting
Container won't start
Check logs to identify the issue:
Docker Compose:
docker compose logs journivDocker Run:
docker logs journivCommon issues:
- Missing
SECRET_KEYorDOMAIN_NAMEenvironment variables - Port already in use (change host port with
-p 8080:8000) - Permission issues with the
/datavolume
Port already in use
Change the host port in your configuration:
Docker Compose:
ports:
- "8080:8000" # Use port 8080 instead of 8000Docker Run:
-p 8080:8000 # Use port 8080 instead of 8000Permission issues
Ensure the data directory is writable:
For bind mounts:
chmod -R 755 /path/to/local/dataFor named volumes: Docker handles permissions automatically. If issues persist, check volume access:
Docker Compose:
docker compose exec journiv ls -la /dataDocker Run:
docker exec journiv ls -la /dataDatabase connection errors
For PostgreSQL setups, verify the following:
Docker Compose:
- PostgreSQL container is healthy:
docker compose ps DATABASE_URLis correct in your configuration- PostgreSQL credentials match between services
Docker Run:
- Verify
DATABASE_URLis correct - Ensure PostgreSQL is accessible from the container
- Check PostgreSQL logs for connection issues
View logs
Docker Compose:
# All services
docker compose logs
# Specific service
docker compose logs journiv
# Follow logs in real-time
docker compose logs -f journivDocker Run:
# Follow logs in real-time
docker logs -f journiv
# View last 100 lines
docker logs --tail 100 journivProduction Checklist
Before deploying to production:
Essentials:
- Strong
SECRET_KEYgenerated and stored securely - Strong
POSTGRES_PASSWORD(if PostgreSQL is used) - Set
DISABLE_SIGNUPtotrueto prevent new user registration - HTTPS configured with reverse proxy
Nice to have:
- Monitoring and alerting set up
- Resource limits configured
- Regular backups plan in place
- Firewall rules configured
- Log rotation configured
- Keep Journiv updated to the latest version
See Configuration for detailed production setup.