Install LimeSurvey on Ubuntu 20.04
If you’re running Ubuntu 20.04 and want to turn your server into a survey‑making machine, this quick guide shows how to get LimeSurvey up and running in under an hour—no fancy scripts or Docker needed.
The Roadmap
- Make sure Apache, PHP, and MariaDB are on board
- Pull the latest LimeSurvey release
- Give it the right permissions
- Kick off the web installer
That’s it. Let’s dive into the details.
1. Prep your system
sudo apt update && sudo apt upgrade -y
Keeps everything fresh and prevents weird dependency conflicts later on.
Now install the LAMP stack, but cherry‑pick only what LimeSurvey actually needs:
sudo apt install apache2 php libapache2-mod-php php-mysql mariadb-server unzip -y
Apache for web serving, PHP (the version bundled with 20.04 is fine), MariaDB as the database engine, and unzip to unpack the distro.
2. Harden PHP a bit
Open /etc/php/7.4/apache2/php.ini (or whatever your PHP‑version folder shows) and tweak these two lines:
memory_limit = 256M max_execution_time = 300
If you leave memory_limit too low, the installer will choke halfway through when it tries to load all its components. Setting a generous timeout protects against slow network pulls.
3. Create a database and user
Start MariaDB’s interactive shell:
sudo mysql -u root
Inside MySQL:
CREATE DATABASE limesurvey CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON limesurvey.* TO 'limesurvey_user'@'localhost' IDENTIFIED BY 'StrongPassword123!'; FLUSH PRIVILEGES; EXIT;
A real‑world tweak: If you’re running multiple sites on the same DB server, give each one its own user to avoid accidental data leaks.
4. Grab LimeSurvey
cd /tmp && wget https://github.com/LimeSurvey/limereleases/releases/download/v5.5.1/limesurvey-5.5.1.zip unzip limesurvey-5.5.1.zip -d /var/www/html/
Rename the extracted folder to something friendly:
sudo mv /var/www/html/limesurvey-5.5.1 /var/www/html/limesurvey
5. Permissions matter
LimeSurvey writes logs and cache files, so it needs write access to a few directories:
sudo chown -R www-data:www-data /var/www/html/limesurvey/
sudo find /var/www/html/limesurvey/ -type d -exec chmod 755 {} \;
sudo find /var/www/html/limesurvey/ -type f -exec chmod 644 {} \;
If you skip this, the installer will complain about “cannot write to…”.
6. Tell Apache to serve it
Create a virtual host file:
sudo nano /etc/apache2/sites-available/limesurvey.conf
Paste:
<VirtualHost *:80>
ServerName limetest.local
DocumentRoot /var/www/html/limesurvey
<Directory /var/www/html/limesurvey>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Enable the site and reload Apache:
sudo a2ensite limesurvey.conf sudo systemctl reload apache2
Add 127.0.0.1 limetest.local to /etc/hosts if you’re testing locally.
7. Run the web installer
Open your browser and go to http://limetest.local. The LimeSurvey wizard will guide you through:
- Choosing the language
- Entering the database credentials you created earlier
- Setting up an admin account
If everything went smoothly, you’ll be greeted by the familiar “LimeSurvey – Welcome!” screen.
Gotchas & What I’ve Seen
- Wrong PHP version: If you accidentally install PHP 8 on a machine still running older extensions, LimeSurvey will complain about missing functions. Stick with the Ubuntu‑provided PHP 7.4 unless you know what you’re doing.
- File permissions: A common pitfall is forgetting that Apache runs as www-data. Without that write permission in /cache and /tmp, installation stalls mid‑step.
- Database name collision: Reusing an existing database can overwrite data—always double‑check the DB name before creating it.
That’s all there is to it. Grab a cup of coffee, hit “Install,” and you’ll have a fully functional survey platform in no time. If you run into hiccups (permissions, PHP errors, etc.), just ping me here or drop a comment—happy to help debug the weirdest quirks.