Install GaiaEHR on Ubuntu 14.04

/ Category: Tutorials / Comments: None

Spread the love

GaiaEHR is an open-source web based electronic health record (EHR) software written in PHP. It is a powerful and easy to use application for medical practice management, prescription and billing management. In this blog article we will install GaiaEHR on an Ubuntu 14.04 Cloud VPS with Apache, PHP and MySQL.

Log in to your Ubuntu 14.04 server as user root:

ssh [email protected]_address

Run the following command to update all of the installed packages on your server:

apt-get update && apt-get upgrade

To run GaiaEHR we need a working LAMP stack (Linux Apache MySQL & PHP), so we will install all these components.

First, install Apache web server:

apt-get install apache2

GaiaEHR is PHP based application, so next we will install PHP among with a few PHP modules required by the application:

apt-get install php5 libapache2-mod-php5 php5-mysql php5-curl php5-mcrypt

Activate the MCrypt module:

php5enmod mcrypt

Next, proceed with installing the MySQL database server in your system using:

apt-get install mysql-server

During the installation you will be prompted to set your MySQL root password.

Once MySQL is installed, run the post-installation script mysql_secure_installation :


- Set root password? [Y/n] n
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Create a new MySQL user and database for GaiaEHR:

mysql -u root -p

mysql> CREATE DATABASE gaiaehr;
mysql> GRANT ALL PRIVILEGES on gaiaehr.* TO 'gaiaehruser'@'localhost' IDENTIFIED BY 'your_password';
mysql> quit;

Don’t forget to replace ‘your_password’, with an actual strong password.

Proceed with installing GaiaEHR. Download the latest available version of the application to your server:


Unpack the downloaded zip archive to the document root directory on your server:

unzip -d /var/www/html/

Change the ownership of the GaiaEHR directory:

chown -R www-data:www-data /var/www/html/gaiaehr/

Create a new virtual host directive in Apache. Copy the default Apache configuration file:

cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/gaiaehr.conf

Open the file and replace the specific values. The Apache virtual host for your GaiaEHR website should look like the following:

vim /etc/apache2/sites-available/gaiaehr.conf
<VirtualHost *:80>

ServerAdmin [email protected]_domain
DocumentRoot /var/www/html/gaiaehr

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


Next, activate the virtual host configuration:

a2ensite gaiaehr

and restart the Apache web server for the changes to take effect:

/etc/init.d/apache2 restart

GaiaEHR has fully graphical and easy to use installation wizard to ease the installation process. So, access your GaiaEHR website at , agree to the GaiaEHR terms and conditions and follow the on-screen instructions to complete the installation. The wizard will check if your server meets all the requirements and you will be prompted to enter the MySQL information, set the administrator account, etc..

Of course you don’t have to do any of this if you use one of our Linux Cloud VPS hosting services, in which case you can simply ask our expert Linux admins to install GaiaEHR for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Be the first to write a comment.

Your feedback