Skip to content
On this page

Running with Docker

Docker images are hosted under the mailcarrier/mailcarrier name.

docker run -p 80:80 -ti mailcarrier/mailcarrier


By default the app runs with a public "App Key" for testing purposes; it's being used to encrypt everything in MailCarrier, so you should use a random, unique, string.
To generate a string, you can run the following command inside your container:

php artisan key:generate --show

Then pass the given value as an env value when running your app:

docker run -e APP_KEY=mysecretstring -p 80:80 mailcarrier/mailcarrier


Always because of testing purposes, the image runs on a volatile sqlite database, but you should definitely connect the app the a proper, persistent mounted database, such as MySQL or PostgreSQL.
You can find an example of the environment variables to customise the app in the .env.example file, for example to connect a database and a redis queue it would be something like:

docker run \
  -e APP_KEY=mysecretstring \
  -e DB_CONNECTION=mysql \
  -e DB_HOST=mysql_host \
  -e DB_USERNAME=mailcarrier \
  -e DB_PASSWORD=secretdbpassword \
  -e REDIS_HOST=redis_host \
  -p 80:80 \