How to Install Cachet on Linux
Cachet is an open source status page system which allows you to inform your users about outages, planned maintances and much more. In this guide we will be installing Cachet on Linux server already running Apache, PHP, and MySQL.
- MySQL Server
First, we have to clone Cachet itself from its Github repository in a directory which we'll be using for it later. Let's assume our directory is
git clone https://github.com/cachethq/Cachet.git cachet/
By default Cachet comes with an
.env.example file. We'll need to rename this file to
.env, regardless of the type environment you're working on. Once renamed, we can edit the file and configure Cache it:
MAIL_NAME="Demo Status Page"
Cachet insists on a database in order to store data. In this guide, we'll be using a MySQL database. Create a new database using the following command:
mysql -u root -p
CREATE DATABASE cachet;
mysql -u root -p assumes you do not have a
/root/.my.cnf with your MySQL server credentials.
We can now create a new MySQL user which is authorized to access our fresh database:
CREATE USER 'cachet'@'localhost' IDENTIFIED BY 'RANDOM_PASSWORD';
GRANT ALL PRIVILEGES ON cachet.* TO 'cachet'@'localhost';
Cache it requires
composer to function. Below is how we can install it:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Cachet provides a built-in method to generate an application key. Cachet uses this application key for all data which is being encrypted. That said, you would want to backup the key somewhere safe.
php artisan key:generate
Now you're ready to install Cachet using another simple command:
php artisan app:install
Note: Never change your application key after this installation; otherwise, Cache will fail to decrypt the data, rendering your installation corrupted.
Cachet itself is a web-based application. Therefore, we'll be using Apache to serve it, thus allowing access to it via browser.
Note: Cachet requires mod_rewrite to be enabled on your Apache server.
We can now continue with creating our VirtualHost. For this step, create a new file called
cachet.conf in the
# Domain from where Cachet will be accessed
Require all granted
# Used by Apache 2.4
Options Indexes FollowSymLinks
Allow from all
We can now start working with Cachet. Simply restart Apache2 using the following command:
service apache2 restart
You should now be able to access your fresh Cachet installation on the domain you set before in the Apache2 config.
Cachet is a pretty well designed open source status page which works on nearly any UNIX and even on Windows based servers. As a result of that Cachet is open source, we can easily implement our own plugins if we're familiar with PHP. Happy Hacking!