How To Install OpenEMR in Ubuntu Linux

OpenEMR is a free medical practice management, electronic medical records, prescription writing, and medical billing application.

Home: http://www.oemr.org/

The following procedure describes How To install the OpenEMR software package in Ubuntu Linux (8.04 LTS)

1. Install a LAMP server

To install a LAMP server (Linux, Apache, MySQL, PHP) in Ubuntu Linux simply do:

  • sudo tasksel install lamp-server
  • sudo /etc/init.d/apache2 restart

If you get an error like: apache2: Could not determine the server's fully qualified domain name, use localhost (127.0.0.1) for ServerName and restart Apache:

  • echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
  • sudo /etc/init.d/apache2 restart

To test the LAMP installation:

  • echo -e "<b>Hello! LAMP is working!</b>" | sudo tee /var/www/index.html # Create a html test message
  • echo -e "<?php\nphpinfo();\n?>" | sudo tee /var/www/phpinfo.php # Create a php test message

2. Download and Prepare OpenEMR

The simplest way to install OpenEMR in Ubuntu seems to be:

  • test -d /home/openemr && sudo rm -fr /home/openemr
  • sudo mkdir -m 0775 -p /home/openemr
  • cd /home/openemr
  • cvs -z3 -d:pserver:anonymous@openemr.cvs.sourceforge.net:/cvsroot/openemr co -P openemr
  • sudo bash -c 'find /home/openemr/ -type f | xargs chmod 0770' # Set File perms to ug+rwx
  • sudo bash -c 'find /home/openemr/ -type d | xargs chmod 0775' # Set Dir. perms to ug+rwx and o+rx
  • test -d /home/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled || sudo mkdir -p -m 0775 /home/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
  • test -d /home/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache || sudo mkdir -p -m 0775 /home/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache
  • sudo chown -R www-data.www-data /home/openemr # Let the Apache web server own the files
  • sudo ln -s /home/openemr /var/www/ # check if it points to openemr: ls -la /var/www/
  • sudo gedit /var/www/openemr/interface/globals.php # edit to make sure that:
    • $webserver_root = "/var/www/openemr";
    • $web_root = "/openemr";
  • sudo gedit /etc/php5/apache2/php.ini # edit to make sure that:
    • upload_tmp_dir = /tmp ; choose other dir if "/tmp" does not suit your system
    • magic_quotes_gpc = Off ; this one must be Off
    • file_uploads = On
    • upload_max_filesize = 2M ; change if you need more
    • memory_limit = 32M ; change ONLY IF NEEDED

3. Install OpenEMR

To install OpenEMR point your browser to: http://localhost/openemr/setup.php and follow instructions from there.

  • When you arrive at: "Please restore secure permissions on the 'library/sqlconf.php' file now.", open a terminal and run:
    • sudo chmod 400 /home/openemr/library/sqlconf.php

4. Start OpenEMR

To start OpenEMR point your browser to: http://localhost/openemr/

  • Default login data:
    • login: admin
    • password: pass

5. Notes