Installing Cachet On Ubuntu (Guide)

Originally written for Linode, here is my guide for installing “Cachet” service status page on Ubuntu and it’s derivatives…

Cachet is a beautiful looking open source service status page that’s easy to setup and use.

Pre-Cachet Setup

Install The Dependencies

  1. Add the PPA repo for PHP:
  2. Install Git and Supervisor:
  3. If you don’t already have Apache, curl and MySQL installed, you’ll need these too but if you already have them then you can just skip this step.

    You’ll be asked for a MySQL root password, be sure to enter something you’ll remember.
  4. Install the PHP dependencies:
  5. Download Composer:
  6. Then move it to /usr/local/bin/composer so that the system knows where to find it:

Setting up a MySQL Database

Cachet need a MySQL database to store your settings and such.

  1. Login to MySQL
  2. Create a database for Cachet:
  3. Give the database a user and password:
  4. Flush the priveleges and exit MySQL:

Install & Configure Cachet

Get Cachet

We’ll get Cachet from GitHub as that way you can download the latest version if you wish.

  1. Navigate to the Apache web files directory:
  2. Clone Cachet using git and change into its directory:
  3. Check for available versions:
  4. Checkout a version. For the sake of this guide we will use v2.0.0-beta2.
  5. Edit the config example file:

    The main parts that need to be changed are as follows:

    You can change the SMTP setting if you wish for Cachet to send out e-mails to subscribers.
    The part that says APP_KEY= can be left default as it gets automatically filled in later.

    If you have APP_DEBUG=true and there is an error, your MySQL details will be publicly visible to anyone visiting the site. This includes your password! Be sure to make it false when in production!

  6. Save and exit with CTRL+O then CTRL+X and hit Y to save.
  7. Rename the example file to just .env:
  8. Run the composer:
  9. When it’s done we need to setup the database with:

    If you get an error at this stage it means your MySQL details are incorrect in the .env file. If this is the case edit it again and then continue from step eight.

  10. Generate a key for the APP_KEY= part of the .env file:

    If you go back and change or edit this key you will lose database data!

Setting up Apache

  1. Open 000-default.conf with nano:
  2. Remove everything by holding down CTRL+K.
  3. Paste in the following text and replace the two status.example.com with your site info:
  4. Save with CTRL+O, overwrite changes with Y then CTRL+X to exit.
  5. Let Apache own the files and folders:
  6. Make sure you have mod rewrite enabled:
  7. Restart apache with service apache2 restart.

Done!

If you navigate to your site, it should all be working fine and present you with a setup page.

If at anytime you change things or run into problems you can clear the config cache with php artisan config:clear, just make sure you cd /var/www/Cachet first.

Issues

If you get a blank page then make sure you have all the PHP dependencies installed and then try composer install --no-dev -o again and then php artisan config:clear sometimes a reboot also does the trick and kicks it into action.

Changing APP_DEBUG=false to APP_DEBUG=true will show you the errors on the site, if any.