The Not_Authorized error usually means RabbitMQ is rejecting the credentials or the user doesn’t have permission to access the virtual host.

1. Check the credentials stored in RabbitMQ

Your Compose file uses a persistent volume (rabbitmq-data). Changing .env does not update credentials in an existing volume.

Run:

docker compose exec rabbitmq rabbitmqctl list_users

2. Reset the password

If appuser exists, set its password to match the value in your .env file:

docker compose exec rabbitmq rabbitmqctl change_password appuser 'YOUR_NEW_PASSWORD'

If the user doesn’t exist, create it and grant administrator access:

docker compose exec rabbitmq rabbitmqctl add_user appuser 'YOUR_NEW_PASSWORD'

docker compose exec rabbitmq rabbitmqctl set_user_tags appuser administrator

docker compose exec rabbitmq rabbitmqctl set_permissions -p / appuser ".*" ".*" ".*"

Replace YOUR_NEW_PASSWORD with the password you want to use. Update .env to match.

Again: once changed/set it will be persisted in the volume.

3. Restart and log in again

docker compose restart rabbitmq

Open http://localhost:15672 and log in with:

  • Username: appuser
  • Password: The password you set above

Important: Avoid deleting the Docker volume to fix authentication; that can erase your RabbitMQ data.

If the error persists, run docker compose logs --tail=100 rabbitmq and check the authentication error details.

By davs