Cachet is a powerful, open-source status page system that helps you communicate downtime and system outages to your users effectively. It provides a sleek and professional way to show your service status. In this guide, we will walk through the steps to install Cachet Status Page System on Debian 12. Whether you're using a local server or a VPS server, this setup will get you up and running in no time.
Prerequisites
Before starting, ensure you have the following:
- A server running Debian 12 (it can be a local machine or a Windows VPS).
- Root access or a user with sudo privileges.
- A working LAMP stack (Linux, Apache, MySQL, PHP) installed on your server.
Step 1: Update Your System
First, update your system to ensure all packages are up to date. Run the following command:
sudo apt update && sudo apt upgrade -y
This will make sure your system is ready for the installation of Cachet and all required dependencies. This step is crucial whether you're using a local server or a VPS server.
Step 2: Install Required PHP Modules
Cachet requires specific PHP extensions. Install them using the following command:
sudo apt install php php-mbstring php-xml php-bcmath php-json php-mysql php-curl php-zip -y
These PHP modules will support the functionality needed for Cachet to run smoothly on your server.
Step 3: Install Composer
Composer is a dependency manager for PHP that Cachet relies on. Install Composer by running:
sudo apt install curl
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Once installed, verify the installation:
composer --version
You should see the version number of Composer if everything is set up correctly.
Step 4: Download and Set Up Cachet
Navigate to the directory where you want to install Cachet, such as the Apache web root directory:
cd /var/www/
sudo git clone https://github.com/CachetHQ/Cachet.git
cd Cachet
Now use Composer to install Cachet's dependencies:
composer install --no-dev -o
Step 5: Configure Cachet
Copy the example environment file to create your own configuration:
cp .env.example .env
Edit the .env
file with your preferred text editor and update the database, email, and app settings:
sudo nano .env
Here, you need to update the database connection settings to match your MySQL configuration. It should look something like this:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=cachet
DB_USERNAME=cachetuser
DB_PASSWORD=yourpassword
Step 6: Set Up MySQL Database
Log into MySQL to create a database and user for Cachet:
sudo mysql -u root -p
Once logged in, run the following commands:
CREATE DATABASE cachet;
CREATE USER 'cachetuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON cachet.* TO 'cachetuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Ensure that the credentials in the .env
file match these MySQL settings.
Step 7: Set Directory Permissions
Set the appropriate ownership and permissions for Cachet's files:
sudo chown -R www-data:www-data /var/www/Cachet
sudo chmod -R 755 /var/www/Cachet
This ensures that the web server (Apache) has permission to access Cachet's files.
Step 8: Set Up Apache Virtual Host
Now, configure Apache to serve your Cachet status page by creating a new virtual host file:
sudo nano /etc/apache2/sites-available/cachet.conf
Add the following configuration:
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/Cachet/public
ServerName yourdomain.com
AllowOverride All
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Save the file and enable the site:
sudo a2ensite cachet.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Step 9: Complete the Installation
Finally, complete the installation by running the following commands:
php artisan key:generate
Migrate the database:
php artisan migrate --force
Once this is done, your Cachet instance should be accessible via your domain or IP address.
Conclusion
By following these steps, you’ve successfully installed the Cachet status page system on Debian 12. Whether it's hosted on a local server or a VPS server, Cachet provides a modern and efficient way to communicate your service status with users. For reliable hosting solutions, check out WindowsVPS.uk for scalable and secure VPS services.