Self-hosting RabbitMQ the easy way

Self-hosting RabbitMQ the easy way

Yulei Chen - Content-Engineerin bei sliplane.ioYulei Chen
4 min

RabbitMQ is one of the most popular open-source message brokers out there. It supports AMQP, MQTT, and STOMP, making it a solid backbone for microservices, background jobs, and event-driven architectures. Managed RabbitMQ services like CloudAMQP or Amazon MQ can get expensive quickly, especially when you need more connections or higher throughput.

Sliplane is a managed container platform that makes self-hosting painless. With one-click deployment, you can get RabbitMQ up and running in minutes - no server setup, no reverse proxy config, no infrastructure to maintain.

Prerequisites

Before deploying, ensure you have a Sliplane account (free trial available).

Quick start

Sliplane provides one-click deployment with presets.

SliplaneDeploy RabbitMQ >
  1. Click the deploy button above
  2. Select a project
  3. Select a server. If you just signed up you get a 48-hour free trial server
  4. Click Deploy!

About the preset

The one-click deploy above uses Sliplane's RabbitMQ preset. Here's what it includes:

  • The official image (rabbitmq:4.3.2)
  • Specific version tag for stability (check Docker Hub for newer versions)
  • Persistent storage mounted to /var/lib/rabbitmq/ so your queues, exchanges, and messages survive restarts
  • Custom admin credentials via RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS environment variables
  • AMQP access on port 5672

Next steps

Once RabbitMQ is running on Sliplane, connect your applications using the domain Sliplane provided (e.g. rabbitmq-xxxx.sliplane.app) or the internal service URL.

Default credentials

The preset generates a random username and password for you. You can find them in the environment variables of your service settings:

  • Username: value of RABBITMQ_DEFAULT_USER
  • Password: value of RABBITMQ_DEFAULT_PASS

Use these to connect your applications via AMQP.

Note: The default guest/guest account in RabbitMQ only works for localhost connections. That's why the preset sets up custom credentials for you.

Connecting your applications

Your applications running on Sliplane can connect to RabbitMQ using the internal service URL. The AMQP port is 5672. A typical connection string looks like:

amqp://USERNAME:PASSWORD@rabbitmq.internal:5672

Replace USERNAME and PASSWORD with the values from your environment variables. If you're using a library like amqplib (Node.js) or pika (Python), just pass the connection string and you're good to go.

Environment variables

Here are the key environment variables you can customize:

VariableDescription
RABBITMQ_DEFAULT_USERUsername for AMQP
RABBITMQ_DEFAULT_PASSAdmin password
RABBITMQ_DEFAULT_VHOSTDefault virtual host (defaults to /)
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGSAdditional Erlang VM arguments

See the official Docker image docs for the full list of supported environment variables.

Enabling additional plugins

RabbitMQ supports a wide range of plugins. To enable additional plugins, you can set the RABBITMQ_PLUGINS environment variable or use a custom enabled_plugins file. Common plugins include:

  • rabbitmq_mqtt for MQTT support
  • rabbitmq_stomp for STOMP support
  • rabbitmq_shovel for moving messages between brokers

Logging

By default, RabbitMQ logs to STDOUT, which works perfectly with Sliplane's built-in log viewer. If you need more verbose output for debugging, set the RABBITMQ_LOG environment variable to debug. For general Docker log tips, check out our post on how to use Docker logs.

Cost comparison

Of course you can also self-host RabbitMQ with other cloud providers. Here is a pricing comparison for the most common ones:

ProvidervCPU CoresRAMDiskEstimated Monthly CostNotes
Sliplane22 GB40 GB€9charge per server
Render12 GB40 GB~$35–$45VM Small
Fly.io22 GB40 GB~$20–$25VM + volume
Railway22 GB40 GB~$15–$66Usage-based

FAQ

What is RabbitMQ used for?

RabbitMQ is a message broker that sits between your services and handles asynchronous communication. Common use cases include background job processing, event-driven microservices, real-time notifications, and decoupling services so they can scale independently. If your app does anything that doesn't need an immediate response (sending emails, processing uploads, syncing data), RabbitMQ is a great fit.

How do I create queues and exchanges?

You can create them programmatically from your application code using any AMQP client library.

How do I update RabbitMQ?

Change the image tag in your service settings on Sliplane and redeploy. For example, update from 4.3.2 to a newer version. Check Docker Hub for the latest stable version. Always check the RabbitMQ release notes before upgrading to be aware of any breaking changes.

Are there alternatives to RabbitMQ?

Yes. Redis can handle basic pub/sub and queuing (we have a guide on setting up Redis with Docker Compose). Apache Kafka is better suited for high-throughput event streaming. NATS is a lightweight alternative for simple messaging. RabbitMQ strikes a good balance between features, reliability, and ease of use.

Can I use RabbitMQ with n8n or other automation tools?

Absolutely. Tools like n8n have built-in RabbitMQ nodes that let you trigger workflows from queue messages or publish messages to RabbitMQ as part of a workflow. Just point the integration at your RabbitMQ instance using the internal service URL and your credentials.

Self-host RabbitMQ now - It's easy!

Sliplane gives you all the tools you need to run RabbitMQ without server hassle.