How to Install LimeSurvey on Ubuntu 18.04 LTS

LimeSurvey is a free and an open source online survey application written in PHP and uses a MySQL or PostgreSQL database. LimeSurvey allow us to create, develop and publish online surveys and collect responses from them, without doing any coding and scripting.

In this tutorial, we will learn how to install and configure LimeSurvey on Ubuntu 18.04 LTS (Bionic Beaver) server.

Requirements

  • A server running Ubuntu 18.04.
  • A non-root user with sudo privileges.

Install LAMP Server

First, install Apache web server and MariaDB server with the following command:

sudo apt-get install apache2 mariadb-server -y

Next, you will need to add ondrej repository to install the latest version of PHP. You can add the repository with the following command:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y

Once the repository is installed, update the repository and install PHP along with all the dependencies with the following command:

sudo apt-get update -y
sudo apt-get install php7.2 php7.2-cli php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-gd php7.2-zip php7.2-ldap php7.2-imap unzip wget curl

Once all the packages are installed, start Apache and MariaDB service and enable them to start on boot by running the following command:

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysql
sudo systemctl enable mysql

Configure MariaDB

Before configuring MariaDB database, secure the MariaDB using the following command:

sudo mysql_secure_installation

Answer all the questions as shown below:

    Enter current password for root (enter for none):
    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

Once the MariaDB is secured, log in to MariaDB shell:

mysql -u root -p

Enter your root password when prompt, then create a database and user for LimeSurvey:

-MariaDB [(none)]>CREATE DATABASE limesurvey_db;
MariaDB [(none)]>GRANT ALL PRIVILEGES ON limesurvey_db.* TO 'limesurvey_user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>\q

Install LimeSurvey

First, you will need to download the latest version of LimeSurvey from their official website. You can download it with the following command:

wget https://download.limesurvey.org/latest-stable-release/limesurvey3.14.3+180809.tar.gz

Once the download is completed, extract the downloaded file with the following command:

tar -xvzf limesurvey3.14.3+180809.tar.gz

Next, copy the extracted directory to the Apache and web root directory and provide necessary permissions:

sudo cp -r limesurvey /var/www/html/
sudo chown www-data:www-data -R /var/www/html/limesurvey

Next, create an apache virtual host for LimeSurvey:

sudo nano /etc/apache2/sites-available/limesurvey.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/limesurvey/
ServerName example.com
<Directory /var/www/html/limesurvey/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/lime-error_log
CustomLog /var/log/apache2/lime-access_log common
</VirtualHost>

Save the file, then enable virtual host with the following command:

sudo a2ensite limesurvey

Finally, restart the Apache web server to make the changes:

sudo systemctl restart apache2

Access LimeSurvey

Now, open your web browser and type the URL http://example.com. You will be redirected to the following page:

Welcome to LimeSurvey installer

Now, click on the Start Installation button. You should see the following page:

Start installation

Now, accept the License agreement and click on the I accept button. You should see the following page:

Pre-installation check

Make sure all the requirements are completed, then click on the Next button. You should see the following page:

Database configuration

Here, provide your database details, then click on the Next button. You should see the following page:

Database settings

Now, click on the Populate database button. You should see the following page:

Populate database with data

Here, provide your admin username and password, site name, email address, then click on the Next button. Once the installation has been completed, you should see the following page:

Installation successful

Now, click on the Administration button. You should see the following page:

Login to LimeSurvey

Now, provide your login details, then click on the Log In button. You should see the following page:

LimeSurvey Dashboard

Share this page:

3 Comment(s)