Knowledgebase

How to Install OpenEMR on Ubuntu 20.04 Print

  • 0

Introduction

OpenEMR is an open-source electronic health records and medical practice management solution. This article explains how to install OpenEMR on Ubuntu 20.04.

1. Install Prerequisites

2. Configure MySQL Database

  1. Log in to MySQL as root.

     # mysql -u root
  2. Create an openemr database.

     MariaDB [(none)]> CREATE DATABASE openemr;
  3. Create a new database user. Replace <PASSWORD> with a strong password.

     MariaDB [(none)]> CREATE USER 'openemr-user'@'localhost' IDENTIFIED BY '<PASSWORD>';
  4. Grant the user permission to access the database.

     MariaDB [(none)]> GRANT ALL PRIVILEGES ON openemr.* TO 'openemr-user'@'localhost';
  5. Reload the grant tables to activate the permission settings.

     MariaDB [(none)]> FLUSH PRIVILEGES;
  6. Exit MySQL.

     MariaDB [(none)]> exit

3. Download OpenEMR

  1. Download OpenEMR.

     # wget https://sourceforge.net/projects/openemr/files/OpenEMR%20Current/6.0.0/openemr-6.0.0.tar.gz

    Please see the OpenEMR Download page for the latest OpenEMR version.

  2. Extract the files.

     # tar xvzf openemr*.tar.gz
  3. Move the openemr-6.0.0 directory to /var/www/html/openemr.

     # mv openemr-6.0.0 /var/www/html/openemr
  4. Give www-data ownership of the directory.

     # chown -R www-data:www-data /var/www/html/openemr
  5. Temporarily give all users read and write access during the installation.

     # chmod 666 /var/www/html/openemr/sites/default/sqlconf.php

4. Install OpenEMR

  1. Navigate to http://example.com/openemr, replacing example.com with your server's IP address. The browser displays the OpenEMR Setup page.

  2. Click Proceed to Step 1 to continue with the installation.

    OpenEMR Pre-install Setup Page

  3. Choose I have already created the database and click Proceed to Step 2 to continue.

    Step 1 - Select Database Setup

  4. In the MySQL Server Details section, enter the database Login Name and Password you set in section two.

  5. In the OpenEMR Initial User Details section, create an Initial User Login Name and Initial User Password.

  6. If you want 2 Factor Authentication, click the Enable 2FA option.

  7. Click Create DB and User.

    Step 2 - Database and OpenEMR Initial User Setup Details

  8. Click Proceed to Step 4.

    Step 3 - Creating Database and First User

5. Configure Apache and PHP

  1. Return to your terminal session.

  2. Edit php.ini.

     # nano /etc/php/7.4/fpm/php.ini
  3. Locate these variables and change their settings as shown.

    • Remove the leading ; character from max_input_vars and change its value to 3000.
    • Change max_execution_time to 60.
    • Change max_input_time to -1.
    • Change post_max_size to 30M.
    • Change memory_limit to 256M.
    • Remove the leading ; character from mysqli.allow_local_infile.
  4. Save and exit the file.

  5. Reload the Apache web server for these changes to take effect.

     # systemctl reload apache2
  6. Return to your web browser.

  7. Click Proceed to Step 5.

    Step 4 - Configure PHP

  8. Return to your terminal session.

  9. Create a new configuration file named openemr.conf.

     # nano /etc/apache2/sites-available/openemr.conf

    Paste the following into the file.

     <Directory "/var/www/html/openemr">
         AllowOverride FileInfo
         Require all granted
     </Directory>
     <Directory "/var/www/html/openemr/sites">
         AllowOverride None
     </Directory>
     <Directory "/var/www/html/openemr/sites/*/documents">
         Require all denied
     </Directory>
  10. Save and exit the file.

  11. Restart Apache.

     # systemctl restart apache2
  12. Return to your web browser.

  13. Click Proceed to Select a Theme.

    Step 5 - Configure Apache Web Server

  14. Choose Keep Current, then click Proceed to Final Step.

  15. A confirmation page appears. Click Start to log in.

  16. (Optional) Register your installation for security updates and new release announcements.

6. Change Permissions

OpenEMR recommends setting file permissions as follows.

# chmod 644 /var/www/html/openemr/library/sqlconf.php
# chmod 644 /var/www/html/openemr/sites/default/sqlconf.php
# chmod 600 /var/www/html/openemr/acl_upgrade.php
# chmod 600 /var/www/html/openemr/setup.php
# chmod 600 /var/www/html/openemr/sql_upgrade.php
# chmod 600 /var/www/html/openemr/ippf_upgrade.php

See the OpenEMR documentation for more details.

More Information

To learn more about OpenEMR, please see these resources:

Introduction OpenEMR is an open-source electronic health records and medical practice management solution. This article explains how to install OpenEMR on Ubuntu 20.04. 1. Install Prerequisites Deploy a LAMP Application on Ubuntu 20.04 cloud server instance from Rcs Marketplace Apps Login as root. Update the server. 2. Configure MySQL Database Log in to MySQL as root. # mysql -u root Create an openemr database. MariaDB [(none)]> CREATE DATABASE openemr; Create a new database user. Replace with a strong password. MariaDB [(none)]> CREATE USER 'openemr-user'@'localhost' IDENTIFIED BY ''; Grant the user permission to access the database. MariaDB [(none)]> GRANT ALL PRIVILEGES ON openemr.* TO 'openemr-user'@'localhost'; Reload the grant tables to activate the permission settings. MariaDB [(none)]> FLUSH PRIVILEGES; Exit MySQL. MariaDB [(none)]> exit 3. Download OpenEMR Download OpenEMR. # wget https://sourceforge.net/projects/openemr/files/OpenEMR%20Current/6.0.0/openemr-6.0.0.tar.gz Please see the OpenEMR Download page for the latest OpenEMR version. Extract the files. # tar xvzf openemr*.tar.gz Move the openemr-6.0.0 directory to /var/www/html/openemr. # mv openemr-6.0.0 /var/www/html/openemr Give www-data ownership of the directory. # chown -R www-data:www-data /var/www/html/openemr Temporarily give all users read and write access during the installation. # chmod 666 /var/www/html/openemr/sites/default/sqlconf.php 4. Install OpenEMR Navigate to http://example.com/openemr, replacing example.com with your server's IP address. The browser displays the OpenEMR Setup page. Click Proceed to Step 1 to continue with the installation. Choose I have already created the database and click Proceed to Step 2 to continue. In the MySQL Server Details section, enter the database Login Name and Password you set in section two. In the OpenEMR Initial User Details section, create an Initial User Login Name and Initial User Password. If you want 2 Factor Authentication, click the Enable 2FA option. Click Create DB and User. Click Proceed to Step 4. 5. Configure Apache and PHP Return to your terminal session. Edit php.ini. # nano /etc/php/7.4/fpm/php.ini Locate these variables and change their settings as shown. Remove the leading ; character from max_input_vars and change its value to 3000. Change max_execution_time to 60. Change max_input_time to -1. Change post_max_size to 30M. Change memory_limit to 256M. Remove the leading ; character from mysqli.allow_local_infile. Save and exit the file. Reload the Apache web server for these changes to take effect. # systemctl reload apache2 Return to your web browser. Click Proceed to Step 5. Return to your terminal session. Create a new configuration file named openemr.conf. # nano /etc/apache2/sites-available/openemr.conf Paste the following into the file. AllowOverride FileInfo Require all granted AllowOverride None Require all denied Save and exit the file. Restart Apache. # systemctl restart apache2 Return to your web browser. Click Proceed to Select a Theme. Choose Keep Current, then click Proceed to Final Step. A confirmation page appears. Click Start to log in. (Optional) Register your installation for security updates and new release announcements. 6. Change Permissions OpenEMR recommends setting file permissions as follows. # chmod 644 /var/www/html/openemr/library/sqlconf.php # chmod 644 /var/www/html/openemr/sites/default/sqlconf.php # chmod 600 /var/www/html/openemr/acl_upgrade.php # chmod 600 /var/www/html/openemr/setup.php # chmod 600 /var/www/html/openemr/sql_upgrade.php # chmod 600 /var/www/html/openemr/ippf_upgrade.php See the OpenEMR documentation for more details. More Information To learn more about OpenEMR, please see these resources: OpenEMR website OpenEMR documentation

Was this answer helpful?
Back

Powered by WHMCompleteSolution