← Back to Documentation

How to Deploy and Monitor RabbitMQ Docker Containers

This guide walks through deploying RabbitMQ containers using ServerBuddy's visual interface, covering both basic deployments and production configurations.

Prerequisites

Your Linux server needs:

  • Docker or Podman installed
  • 512MB+ available RAM
  • 10GB+ free disk space

You can check Docker installation by navigating to the "Containers" tab or by running the following in the Terminal:

docker --version
# or
podman --version

Creating a RabbitMQ Container with GUI

Step 1: Navigate to Docker Management

  1. Connect to your server via ServerBuddy
  2. Click the "Containers" tab

Docker Containers View

Step 2: Configure Container Parameters

Click the "+ Add" button in the top right to open the container dialog:

Basic Configuration

  • Image: rabbitmq:3.12-management (includes management UI)
  • Container Name: production-rabbitmq (descriptive naming)
  • Command: Leave empty (uses RabbitMQ default entrypoint)

Port Mappings

Enter the following in the port mappings section:

  • Host Port: 5672Container Port: 5672 (AMQP protocol)
  • Host Port: 15672Container Port: 15672 (Management UI)
  • Alternative: Use 5673 and 15673 on host if defaults are occupied

Environment Variables (Critical for RabbitMQ)

Add these essential RabbitMQ environment variables:

Variable Value
RABBITMQ_DEFAULT_USER admin
RABBITMQ_DEFAULT_PASS YourSecurePassword123!
RABBITMQ_DEFAULT_VHOST /
RABBITMQ_ERLANG_COOKIE secret-cookie-value

Volume Mappings for Data Persistence

Configure persistent storage to survive container restarts:

  • Mount: rabbitmq-production-data (Docker volume name)
  • Container Path: /var/lib/rabbitmq

For configuration files (optional): - Mount: rabbitmq-config (Docker volume name) - Container Path: /etc/rabbitmq

This ensures your queues and messages persist even if the container is removed.

Network Configuration

  • Choose custom network for multi-container applications
  • ServerBuddy shows available networks in a dropdown

Runtime Options

  • Restart Policy: Select "Unless Stopped" for production
  • Run in detached mode: Keeps container running in background
  • Remove on exit: Keep unchecked for message brokers

New RabbitMQ Container Configuration

Step 3: Deploy the Container

Click "Create Container" to:

  1. Pull the RabbitMQ image if not present
  2. Create volume directories
  3. Start the container with specified configuration
  4. Display creation status

The container should be running within 15-20 seconds.

Monitoring RabbitMQ Container Health

Container Status Indicators

The Docker containers view displays:

Container Status Indicators

  • 🟢 Green: Running healthy
  • 🟡 Yellow: Starting/restarting
  • 🔴 Red: Stopped or errored
  • Gray: Paused

Available Container Actions

Hover over the container row to access:

  • Start/Stop/Restart controls

Checking RabbitMQ Performance

Container Resource Usage

You can view this by double clicking on your container entry in the containers table.

RabbitMQ Container Resource Monitoring

The container details view shows:

  • Memory consumption vs. limits
  • CPU usage percentage (real-time graph)
  • Network I/O rates (inbound/outbound)
  • Disk read/write operations

RabbitMQ Internal Metrics

Connect via the Terminal tab:

  1. Click the Terminal tab
  2. Access RabbitMQ management tools

Connect to RabbitMQ CLI:

docker exec -it production-rabbitmq rabbitmqctl status

List queues and messages:

docker exec -it production-rabbitmq rabbitmqctl list_queues name messages consumers

Run diagnostic commands:

# Check cluster status
docker exec -it production-rabbitmq rabbitmqctl cluster_status

# List connections
docker exec -it production-rabbitmq rabbitmqctl list_connections

# List channels
docker exec -it production-rabbitmq rabbitmqctl list_channels

# Check memory usage
docker exec -it production-rabbitmq rabbitmqctl status | grep memory

# List users
docker exec -it production-rabbitmq rabbitmqctl list_users

# List virtual hosts
docker exec -it production-rabbitmq rabbitmqctl list_vhosts

Management UI Access

RabbitMQ provides a comprehensive web management interface:

  1. Open your browser and navigate to: http://your-server-ip:15672
  2. Login with credentials:
  3. Username: admin (or your configured user)
  4. Password: Your configured password

The management UI provides: - Real-time queue statistics - Connection and channel monitoring - Message rates and throughput graphs - Node memory and disk usage - Exchange and binding visualization

Log Analysis

You can view the logs for the container in the "Logs" tab by changing the log source to "Containers", and then selecting your container from the dropdown list.

The log viewer offers:

  • Filtering by log level (ERROR, WARNING)
  • Text search across logs
  • Real-time updates

Troubleshooting Connection Issues

If you can't connect to RabbitMQ: 1. Check port mapping in container details (5672 for AMQP, 15672 for management) 2. Review container logs for authentication errors 3. Verify RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS are set 4. Confirm firewall rules allow the connections 5. Test management UI access via browser

Security Best Practices

  • Change default credentials immediately
  • Use strong passwords for all users
  • Limit management UI access to specific IPs
  • Configure SSL/TLS for encrypted connections
  • Set appropriate resource limits and alarms
  • Implement proper user permissions and virtual hosts
  • Regularly update RabbitMQ images
  • Monitor disk space to prevent message loss
  • Enable authentication mechanisms like LDAP if needed

Common Issues and Solutions

Container Won't Start

  • Check logs for error messages
  • Verify ports 5672 and 15672 are available
  • Ensure image exists and is pulled
  • Check volume mount permissions
  • Verify environment variables are correctly set

Connection Refused

  • Confirm container is running
  • Verify port mappings
  • Check firewall rules
  • Review authentication credentials
  • Ensure client libraries are configured correctly

High Memory Usage

  • Check queue lengths and consumer lag
  • Review message TTL settings
  • Monitor unacknowledged messages
  • Configure memory alarms
  • Implement queue length limits

Key Takeaways

  • Always use volumes for data persistence at /var/lib/rabbitmq
  • Management UI on 15672: Essential for monitoring and administration
  • AMQP protocol on 5672: Standard messaging port
  • Set secure credentials: Never use default guest/guest in production
  • Configure resource limits to prevent container from consuming all system resources
  • Use restart policies for automatic recovery
  • Monitor queue depths to prevent memory issues
  • Backup regularly using RabbitMQ export/import tools