RabbitMQ
Service Restart
Message Queue
System Administration
Troubleshooting

How to restart the RabbitMQ service on Linux and Windows

Codemia Knowledge Hub ·

On Linux with systemd, run sudo systemctl restart rabbitmq-server (or sudo service rabbitmq-server restart on SysV init). On Windows, use PowerShell's Restart-Service RabbitMQ, or stop and start the service.

When a restart is needed

  1. Configuration changes: edits to rabbitmq.conf often need a restart to take effect.
  2. Plugin management: adding or removing plugins may need a restart to initialize or clean up plugin state.
  3. Performance problems: memory leaks, high CPU usage, or an unresponsive service.
  4. Upgrades: after upgrading RabbitMQ or Erlang/OTP, a restart is generally required to run the new version.

Restart commands by operating system

Unix/Linux

Use systemctl or service, depending on your distribution:

  • Using systemctl (systemd):
bash
  sudo systemctl restart rabbitmq-server
  • Using service (SysV init):
bash
  sudo service rabbitmq-server restart

Both stop the running broker and start it again, picking up new configuration and resetting its state.

Windows

Use the Services console or PowerShell:

  • Command line:
powershell
1  # Stop the service
2  Stop-Service RabbitMQ
3  # Start the service
4  Start-Service RabbitMQ

Command reference

ActionCommand for LinuxCommand for WindowsPurpose
Stop Servicesudo systemctl stop rabbitmq-serverStop-Service RabbitMQHalts the RabbitMQ service.
Start Servicesudo systemctl start rabbitmq-serverStart-Service RabbitMQInitiates the RabbitMQ service.
Restart Servicesudo systemctl restart rabbitmq-serverRestart-Service RabbitMQRestarts the service, applying changes.

Restarting without losing messages

  • Notify users: announce the maintenance window so nobody is surprised.
  • Back up configuration: save rabbitmq.conf and any custom definitions before changing them.
  • Drain queues: if possible, let queues drain and pause publishing to reduce message loss.
  • Monitor afterwards: watch logs and metrics to confirm the broker is healthy.

Checking logs and restarting a cluster

Logs: after a restart, check the logs in /var/log/rabbitmq/ on Linux or %APPDATA%\RabbitMQ\log on Windows for startup errors.

Clusters: restart nodes one at a time to keep the service available and avoid cluster partitions.


Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design