Install GaiaEHR on Ubuntu 14.04

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 root@IP_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 :

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> FLUSH PRIVILEGES;
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:

wget http://downloads.sourceforge.net/project/gaiaehr/GaiaEHR_v0.0.7_Beta.zip

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

unzip GaiaEHR_v0.0.7_Beta.zip -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 webmaster@your_domain
ServerName yourdomain.com
DocumentRoot /var/www/html/gaiaehr

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

</VirtualHost>

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 http://yourdomain.com , 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.

2 thoughts on “Install GaiaEHR on Ubuntu 14.04”

  1. Good work!

    The problem with the commands is that the installation of php5 gives an error of “no installation candidate”!

    Are there no commands for up to date versions of ubuntu like 18.08,20.04………..

    Reply

Leave a Comment