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:

Suggested articles

3 Comment(s)

Add comment

Comments

By: BSCadmin at: 2018-10-29 14:20:20

Hi,

After installing everything get stuck on check before install - have no PHP PDO, LDAP, zip and imap - tried to install them, says that Ubuntu 18.04 can't install those packages. Maybe someone had this problem adn could tell me da fudge I'm doing wrong.

By: Cris at: 2018-11-08 15:57:06

Thanks for tutorial. Everything went smooth and the database was recognized and tables seen as populated (this is an update installation on another server).

The last screen when the installation finished, said that I will be redirected and since then I can't access no more to http://"mydomainname"/limesurvey

I also have to say that I'm running apache2 on a VM that is located in a NAT and access the web through a PFsense VM firewall/router.Any idea? The folders on the requirement page were green as found and writable though

Thank you

By: Seetesh at: 2019-04-24 05:44:20

What do I type on the URL on the same machine after i shutdown the same. http:\\ipaddress\limesurvey doesnt take me to the login page