Skip to main content
This guide covers deploying Ralph using Docker containers. This method is ideal for development, testing, and containerized production environments.

Overview

The Docker installation uses official Ralph images:
  • allegro/ralph:latest - Main Ralph application
  • allegro/ralph-static-nginx:latest - Nginx server for static files
  • mysql:5.7 - Database server
  • redis:3.0 - Cache and task queue

Prerequisites

  • Docker Engine 20.10+
  • Docker Compose 2.0+
  • 4GB+ RAM available for containers
  • 10GB+ disk space

Quick Start

1

Install Docker and Docker Compose

If you don’t have Docker installed, follow the official installation guide:Verify installation:
2

Create Docker Compose Configuration

Create a new directory for Ralph and a docker-compose.yml file:
Add the following configuration:
docker-compose.yml
This configuration uses default passwords. For production, change all passwords to strong, unique values.
3

Pull Docker Images

Download the required Docker images:
4

Initialize Database

Initialize the Ralph database (run this only once):
This will:
  • Run database migrations
  • Sync the application menu tree
  • Create a default superuser
The initialization script will prompt you to create a superuser account. Save these credentials securely.
5

Load Demo Data (Optional)

To populate Ralph with demonstration data:
6

Start Ralph

Start all services:
Ralph will be available at:
If using Docker Toolbox or boot2docker, use $(docker-machine ip) instead of localhost.

Container Management

View Running Containers

Stop and Start Services

Upgrade Ralph

1

Pull Latest Images

2

Run Upgrade Script

3

Restart Services

Environment Variables

Customize Ralph by setting environment variables in the docker-compose.yml file:

Database Configuration

Redis Configuration

Additional Settings

Data Persistence

Data is stored in Docker volumes to persist across container restarts:
  • ralph_dbdata - MySQL database files
  • ralph_media - User-uploaded media files
  • ralph_static - Static assets (CSS, JS, images)

Backup Volumes

Advanced Configuration

Using PostgreSQL Instead of MySQL

Running Behind a Reverse Proxy

If running behind nginx or another reverse proxy:
Configure your reverse proxy to forward requests to http://localhost:8080.

Troubleshooting

Check for port conflicts:
Ensure Docker has enough resources (memory, disk space).
The database container may take time to initialize:
Ensure volumes are properly mounted:
On Linux, you may need to adjust volume permissions:

Next Steps

Configuration

Configure LDAP, OpenStack sync, and advanced features

Data Migration

Import existing data or migrate from Ralph 2