How to Install Bolt on a VPS Running Ubuntu 12.04



Bolt is an open source content management system built in PHP. Simplicity in configuration and usage makes it popular among content editors, back-end developer and front-end designers.

This tutorial will cover the installation of Bolt on a VPS running Ubuntu 12.04.


System Prerequisites


  • VPS running Ubuntu 12.04
  • Apache or Nginx web server
  • LAMP stack installed on server. If you need guidance in installing Linux, Apache, MySQL and PHP, refer to this tutorial.
  • PHP 5.3.2 or higher version
  • SQLite or PostgreSQL database



Installation of Bolt


As a matter of fact, there are quite a few ways of installing Bolt. However, in this tutorial, we will be using the command line method.

To begin with, let’s create a folder where you would like to install Bolt.

cd /var/www
mkdir bolt
cd bolt

Now, go ahead and download the latest distribution of Bolt;


Untar the downloaded file and remove it.

tar -xzf bolt_latest.tgzrm bolt_latest.tgz

Going forward, you will need to set permissions to some of the folders:

chmod -R 777 files/ app/database/ app/cache/ app/config/ theme/


Configuring Bolt


SQLite is the default database for Bolt. Here, we will see how to change it to MySQL.

First, you need to create a database for bolt. Go to the MySQL command line and type in the command:

create database bolt;

Do a quick check on the installed Bolt files from your browser by giving your IP_address/bolt. Making this browser request is essential in getting the configuration files renamed. Do not close the page.

Now, we need to edit the config file for specifying the database and other details:

nano app/config/config.yml

Open the file and replace the SQLite configuration for mysql. It should look like this:

  driver: mysql
  username: your username
  password: your password
  databasename: bolt

After making the changes, save and exit the file. Refresh the page in your browser. You will be directed to a page where you can set up a user account. If you get any 404 error, it can mean either if two things:

  1. .htaccess file directives are not overriding the Apache instructions or
  2. Mod_rewrite module is not enabled


You can check if the mod_rewrite module is enabled or not using the command:

apache2ctl -M

If it gives you rewrite_module in the list, then it is already enabled. If not, you can enable it by running this command:

a2enmod rewrite

Now, check the apache default virtual host file and ensure that Allow Overrides is set to All. You can locate the file under /var/www directory. If it’s not set, you can make the corresponding changes to the file:

nano /etc/apache2/sites-available/default
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

This step will ensure .htaccess files to override default apache instructions.

In case if you have done any of these configuration changes, you will have to restart the apache server in order to bring in your changes into effect.

sudo service apache2 restart

Note: You may wish to install certain PHP extensions for Bolt so as to make it more efficient. These should be run before restarting the Apache server.

sudo apt-get updatesudo apt-get install php5-gdsudo apt-get install php5-curl


Accessing Bolt


Refresh your browser again and you will be taken to a form where you can create first user account. Create an account and log in with those details.

If you want to access your site’s home page, you can do that by giving ip_address/bolt in your browser. You will be able to see the bolt dashboard at ip_address/bolt/bolt.

In case if you want your site to be available directly at IP address, you can achieve that using any of these methods mentioned below:

  1. Move all the Bolt files to /var/www, which is the web server’s root folder.
  2. Change the web server’s root directory to /var/www/bolt.
nano /etc/apache2/sites-available/default
DocumentRoot /var/www/

Restart Apache:

sudo service apache2 restart
  1. Create a new virtual host with a domain name with that directory as its document root.

You can follow either of these steps to bring your Bolt site directly.


support2 has written 111 articles

Leave a Reply