Skip to content

Repository files navigation

Docker Cachet

A Docker setup for Cachet - an open-source status page system built with Laravel.

Overview

This repository provides a complete Docker setup for running Cachet with the following components:

  • Cachet Application - The main web application
  • Queue Worker - Handles background jobs
  • Scheduler Worker - Manages scheduled tasks
  • MariaDB Database - Database backend

Prerequisites

Before you begin, ensure you have the following installed on your system:

Quick Start

1. Clone the Repository

git clone https://github.com/steffjenl/docker-cachet.git
cd docker-cachet

2. Configure Environment Variables

Copy the example environment file and customize it:

cp .env.example .env

Edit the .env file and update the following required variables:

# Application settings
APP_NAME=YourStatusPage
APP_URL=http://localhost:8080
APP_KEY= # Will be generated automatically# Database settings
DB_PASSWORD=your_secure_password_here
# Mail settings (optional but recommended)
MAIL_MAILER=smtp
MAIL_HOST=your.smtp.host
MAIL_PORT=587
MAIL_USERNAME=your_email@domain.com
MAIL_PASSWORD=your_email_password
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"

3. Start the Services

docker compose up -d

This will start all services in the background:

  • Cachet web application on port 8080
  • MariaDB database
  • Queue worker for background jobs
  • Scheduler worker for automated tasks

4. Generate Application Key

After the containers are running, generate the Laravel application key and paste into your .env file:

docker compose exec cachet-app php artisan key:generate --show

5. Run Database Migrations

Set up the database tables:

docker compose exec cachet-app php artisan migrate --force

6. Create the first user

Create the first user by following the prompts:

docker compose exec -it cachet-app php artisan cachet:make:user

7. Access Your Status Page

Open your web browser and navigate to:

http://localhost:8080

Follow the setup wizard to complete the installation.

Configuration

Environment Variables

The .env file contains all configuration options. Key variables include:

VariableDescriptionDefault
APP_NAMEYour status page nameCachet
APP_URLBase URL for your installationhttp://localhost
APP_DEBUGEnable debug mode (set to false in production)false
DB_PASSWORDDatabase passwordExamplePassword!2020!
MAIL_MAILERMail driver (smtp, log, etc.)log

Port Configuration

By default, the application runs on port 8080. To change this, edit the docker-compose.yml file:

ports:
- "YOUR_PORT:80"

Custom Domain

To use a custom domain:

  1. Update APP_URL in your .env file
  2. Configure your web server/reverse proxy to forward requests to the Docker container
  3. Ensure SSL/TLS certificates are properly configured if using HTTPS

Production Deployment

Security Considerations

  1. Change default passwords: Update DB_PASSWORD in your .env file
  2. Use HTTPS: Configure SSL/TLS certificates
  3. Secure database: Restrict database access and use strong passwords
  4. Environment variables: Keep your .env file secure and never commit it to version control
  5. Updates: Regularly update the Docker images

Reverse Proxy Setup (Nginx Example)

server{listen80;server_namestatus.yourdomain.com;location / {proxy_passhttp://localhost:8080;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;}}

Maintenance

Updating

To update to the latest version:

docker compose pull
docker compose up -d

Backup

Database Backup

docker compose exec cachet-mariadb mysqldump -u root -p cachet > backup_$(date +%Y%m%d_%H%M%S).sql

Restore Database

docker compose exec -i cachet-mariadb mysql -u root -p cachet < backup_file.sql

Logs

View application logs:

docker compose logs -f cachet-app

View all service logs:

docker compose logs -f

Troubleshooting

Common Issues

  1. Permission errors: Ensure Docker has proper permissions
  2. Port conflicts: Make sure port 8080 isn't already in use
  3. Database connection issues: Verify database credentials in .env

Reset Installation

To start fresh:

docker compose down -v
docker compose up -d

Warning: This will delete all data including your database.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Support

License

This project is licensed under the MIT License. See the Cachet license for details.

About

Docker image for Cachet Statuspage

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages