How many times did you need to ask your friends for an opinion or a vote? Some Google modules can help this but when you want to privately host your surveys the best answer is LimeSurvey on Raspberry PI
In this tutorial, I’m going to show you how to install LimeSurvey on Raspberry PI computer boards (excluding Raspberry PI Pico, as it is a microcontroller).
LimeSurvey is a useful, web-based survey tool allowing you to organize in a simple way your requests for opinions, interests, and much more. LimeSurvey helps you both in creating simple questionnaires or working on sophisticated surveys with complex validation rules, conditional logic and quota management. It is also a complete tool able to allow professional market researchers to investigate potential customer’s opinions and interests, so driving decisions based on what people like.
LimeSurvey has cloud based services (with fees), but they release also an open source, community version (LimeSurvey CE) of their software for people wanting to use their tool on self hosted environments.
For this project, I’m going to use a Raspberry PI 3 model B+, but this will work with any Raspberry PI computer boards (no Raspberry PI Pico, as it is a microcontroller and not a computer).
Please note that if you want to publish your surveys on the internet, you can use my tutorial on No-IP with Raspberry PI, which also tells you what checks are to be performed to understand if you have all IPS requirements satisfied.
What We Need
As usual, I suggest adding from now to your favourite e-commerce shopping cart all needed hardware, so that at the end you will be able to evaluate overall costs and decide if continue with the project or remove them from the shopping cart. So, hardware will be only:
- Raspberry PI computer board (including proper power supply or using a smartphone micro usb charger with at least 3A)
- high speed micro SD card (at least 16 GB, at least class 10)
Check hardware prices with following links:
Prepare Operating System
Start installing the OS for your RPI. I suggest using Raspberry PI OS Lite as it assures a fast environment with a headless configuration. But you can also use Raspberry PI OS Desktop, in this case using its internal terminal.
Make sure your OS is up to date. From terminal, use the following command:
sudo apt update -y && sudo apt upgrade -y
Setup the LAMP server
We need to configure a Linux-Apache-Mysql-Php server in order to run LimeSurvey. Instead of MySQL, we’ll use MariaDB as assures better performances also in low capacity hardware as Raspberry PI. For this step, please refer to my tutorial to install LAMP server in Raspberry PI (phpmyadmin is optional).
Install required modules
According to LimeSurvey docs, the minimum requirements are following:
- Minimum 250 MB disk space
- MySQL 5.5.3 or later
- Minimum PHP 7.2.5 or later; with the following modules/libraries enabled:
- PDO database driver
Optional PHP Extensions are following:
With our previous installation step, we’ll find the following modules already installed by default:
- PDO: available in default php installation
- hash: available in default php installation
- session: available in default php installation
- openssl: available in default php installation
- zlib: available in default php installation
- fileinfo: available in default php installation
Install missing packages with the terminal command:
sudo apt install php7.3-mbstring php7.3-gd php7.3-imap php7.3-ldap php7.3-zip php7.3-xml -y
We also need a restart of apache service to get all modules activated:
sudo systemctl restart apache2.service
Get LimeSurvey copy
Check the latest LimeSurvey community edition version from LimeSurvey download page. You can both download it from an external PC and then move the package to your RPI via an SFTP software (like Filezilla) or you can get the download link by right click on “Download” button, then “Copy link address”:
and finally using the get command from your Raspberry PI terminal to download the package directly in your device (please change the link with the one you just copied):
Now we need to uncompress the package and move its content to the default apache web folder. These can be achieved with a single command (please use the correct name for the package downloaded according to the version available at your time):
sudo unzip limesurvey5.1.10+210913.zip -d /var/www/html/
Finally, “sudo” copies files as root user. To apply the correct permissions we also need to give files ownership to the default apache user (www-data) and group (www-data):
sudo chown www-data:www-data -R /var/www/html/limesurvey/
Prepare Database Permissions
LimeSurvey needs proper database permissions to work. The minimal are SELECT, CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, INDEX. We’ll grant all privileges into a specific, dedicated database inside MariaDB so that all the minimum requirements will be satisfied. Before running the following command, please choose your personal database name, user and password and use that instead of my “limeSurveyDB”, “limeSurveyUser” and “limeSurveyPassword”. Please also remember these values for the next installation steps and for future possible needs.
Also, note that the default password for mysql command with MariaDB is empty (just press RETURN) unless modified with the “sudo mysql_secure_installation” command at LAMP installation time.
sudo mysql -uroot -p create database limeSurveyDB; create user limeSurveyUser@localhost identified by 'limeSurveyPassword'; grant all privileges on limeSurveyDB.* to limeSurveyUser@localhost; flush privileges; quit
If everything gone successful, we are now ready to move to browser steps.
Finalize LimeSurvey Installation
The latest steps can be done from a web browser. Using your favourite one, keep your Raspberry PI’s IP address instead of mine “192.168.1.239” (or use your domain, if you have one) and go to URL “http://192.168.1.239/limesurvey/admin”:
The first page welcomes you and allows selecting the preferred language. Please choose your preferred one and click “Start installation” button at the bottom right:
The next page gives you the license overview. Continuing installation requires accepting it by clicking “I accept” button:
The following page checks that all requirements are met. By scrolling down, you will find all requirements available. Please press “next” button at the end of the page to move forward:
Now database configuration page has to be filled. Using the ones you defined in the previous “Prepare Database Permissions”, set according to the following map:
- Database type: MySQL (leave default)
- MySQL database engine type: MyISAM (leave default)
- Database location: localhost (leave default)
- Database user: limeSurveyUser
- Database password: limeSurveyPassword
- Database name: limeSurveyDB
- Table prefix: lime_ (you can leave default)
Finally press “next” button at the end of the page
Next page warns you that a database with “limeSurveyDB” name already exists. This is correct, as we defined the user and its permission restricted only to this specific database, without extending all privileges for limeSurveyUser to the whole MariaDB instance.
You can press “Populate database” button to continue:
The final page confirms that the database has been successfully populated and let you choose your administrative account details/password (for web interface use) instead of the default Limesurvey user:
- Admin login name: admin
- Admin login password: password
Please fill according to your preferences and press “next” button at the end of the page:
Finally, a confirmation page tells us that everything has gone correctly:
The “Administration” button brings us to the login page:
Create Your First Survey
At this point, your Limesurvey installation is finished. You can now start creating surveys by following the official LimeSurvey guide to create a new survey.
For example, I’ve created a simple multiple option survey to ask friends what time they prefer to schedule for a dinner:
And the following are results by injecting some answers:
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?