Skip to main content

Add to Dependencies

Add bullmq to your list of dependencies in mix.exs:
Then run:

Requirements

  • Elixir: 1.15 or higher
  • Erlang/OTP: 26 or higher
  • Redis: 6.0 or higher (7.0+ recommended for best performance)

Dependencies

BullMQ for Elixir includes the following dependencies:
  • redix (~> 1.3) - Redis client
  • nimble_pool (~> 1.0) - Connection pooling
  • nimble_options (~> 1.0) - Configuration validation
  • jason (~> 1.4) - JSON encoding/decoding
  • crontab (~> 1.1) - Cron expression parsing
  • msgpax (~> 2.4) - MessagePack encoding for Lua scripts
  • elixir_uuid (~> 1.2) - UUID generation
  • telemetry (~> 1.2) - Instrumentation and monitoring

Redis Setup

BullMQ requires a Redis server. You can:

Run Redis Locally

Use a Managed Redis Service

For production, consider using a managed Redis service:

Add Redis Connection to Supervision Tree

Add a Redix connection to your application’s supervision tree:

Configuration

You can configure your Redis connection in config/config.exs:
Then in your application:

Verify Installation

You can verify the installation by running:
You should see bullmq in the list of dependencies.

Test Redis Connection

Create a simple test to verify your Redis connection:

Common Issues

Redis Connection Errors

If you can’t connect to Redis:
  1. Verify Redis is running: redis-cli ping (should return PONG)
  2. Check your host and port configuration
  3. Ensure your firewall allows connections to the Redis port (default: 6379)
  4. If using Redis Cloud or other managed services, verify credentials

Compilation Errors

If you encounter compilation errors:
  1. Ensure you’re running Elixir 1.15+ and Erlang/OTP 26+
  2. Run mix deps.clean --all && mix deps.get
  3. Try mix clean && mix compile

Optional: Telemetry Setup

For monitoring and observability, you can set up Telemetry handlers:
Call this in your application start:

Next Steps

Usage Guide

Learn how to create queues and workers