Operating System CentOS

How to Install LimeSurvey 7 on AlmaLinux 9 or Rocky Linux 9

Install LimeSurvey Community Edition 7 on AlmaLinux 9 or Rocky Linux 9 with Apache, PHP 8.3, MariaDB, SELinux labels and a Let's Encrypt certificate.

This guide installs LimeSurvey Community Edition 7 on AlmaLinux 9 or Rocky Linux 9 with Apache, PHP 8.3 and MariaDB, and secures it with a Let's Encrypt certificate. At the end you will have a working survey server at https://survey.example.com and an administrator account.

CentOS 7 reached end of life in June 2024, and its PHP is far too old for current LimeSurvey. LimeSurvey 7 is the current release line; the 6.x line reached its end of support on 31 August 2026.

Requirements

  • A server running AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9, a user with sudo rights, and a DNS record such as survey.example.com pointing to it.
  • PHP: the LimeSurvey download page lists PHP 8.2.27 or newer for the 7.x packages. The default PHP on a RHEL 9 compatible system is 8.0, so this guide enables the 8.3 module stream.
  • PHP extensions: mbstring, a PDO database driver, GD, Zip, Zlib, cURL, fileinfo and JSON are required; Intl and LDAP are optional.
  • Database: MariaDB 10.3.38 or newer, MySQL 8 or newer, or PostgreSQL 14 or newer. The MariaDB shipped with RHEL 9 compatible systems meets this.
  • At least 500 MB of disk space; the unpacked 7.x package alone takes about 380 MB.

Step 1: Install Apache, PHP 8.3 and MariaDB

Enable the PHP 8.3 module stream and install the packages. On RHEL 9 compatible systems PHP runs through PHP-FPM, and JSON, cURL, fileinfo and Zlib support are part of the base PHP packages.

sudo dnf module enable php:8.3
sudo dnf install httpd mod_ssl mariadb-server unzip policycoreutils-python-utils \
  php php-fpm php-mysqlnd php-gd php-mbstring php-xml php-pecl-zip php-intl php-ldap

Confirm the version meets the requirement:

php -v

LimeSurvey recommends higher PHP limits than the defaults. Create /etc/php.d/99-limesurvey.ini:

memory_limit = 256M
max_input_vars = 5000
post_max_size = 32M
upload_max_filesize = 32M

Start the services and enable them at boot:

sudo systemctl enable --now httpd php-fpm mariadb

Step 2: Create the database

Secure the MariaDB installation, then open a client session as root:

sudo mariadb-secure-installation
sudo mariadb

Create a database with the character set LimeSurvey recommends and a user limited to the privileges it needs. Replace the password.

CREATE DATABASE limesurvey CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'limesurvey'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT SELECT, CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, INDEX ON limesurvey.* TO 'limesurvey'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 3: Download and unpack LimeSurvey

The package file name contains the version and build number and changes with every release. Open the Community Edition page at community.limesurvey.org/downloads, copy the link of the current 7.x ZIP file, and download it on the server. The file names below are placeholders for the one you copied:

cd /tmp
curl -LO https://download.limesurvey.org/latest-master/limesurvey7.x.y+build.zip

A matching SHA-256 checksum file is published next to each package. Compare it with the result of:

sha256sum limesurvey7.x.y+build.zip

Unpack the archive, which creates /var/www/limesurvey:

sudo unzip -q limesurvey7.x.y+build.zip -d /var/www/

The web server needs write access to three directories only: tmp, upload and application/config. Everything else can stay read-only. Set the ownership and the matching SELinux label:

sudo chown -R apache:apache /var/www/limesurvey/tmp /var/www/limesurvey/upload /var/www/limesurvey/application/config
sudo chmod -R 755 /var/www/limesurvey/tmp /var/www/limesurvey/upload /var/www/limesurvey/application/config
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/limesurvey/(tmp|upload|application/config)(/.*)?"
sudo restorecon -R /var/www/limesurvey

If LimeSurvey will send invitations through an external SMTP server, allow outgoing connections from the web server processes:

sudo setsebool -P httpd_can_network_connect 1

Step 4: Configure Apache and HTTPS

Create /etc/httpd/conf.d/limesurvey.conf. AllowOverride All lets the .htaccess files shipped with LimeSurvey take effect.

<VirtualHost *:80>
    ServerName survey.example.com
    DocumentRoot /var/www/limesurvey

    <Directory /var/www/limesurvey>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Check the syntax, reload Apache and open the firewall:

sudo apachectl configtest
sudo systemctl reload httpd
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload

Get a certificate with Certbot from the EPEL repository. It creates the HTTPS virtual host and offers to redirect HTTP to HTTPS:

sudo dnf install epel-release
sudo dnf install certbot python3-certbot-apache
sudo certbot --apache -d survey.example.com

Step 5: Run the web installer

Open https://survey.example.com. The installer starts automatically and takes you through these screens:

  1. Language and licence.
  2. Pre-installation check. Every required item must pass; a failed item here almost always points to a missing PHP extension or a directory that is not writable.
  3. Database configuration: choose MySQL as the type, localhost as the location, and enter the limesurvey user, its password and the database name from step 2.
  4. Administrator account and site settings. Choose your own administrator name and a strong password here. If you leave the fields unchanged, the account is admin with the password password, which you must change immediately.

When the installer has finished, log in at https://survey.example.com/admin.

Verify and troubleshoot

Create a short test survey, activate it and submit one response from another browser. Also send yourself a test invitation to confirm that outgoing mail works.

  • A blank page or HTTP 500: read /var/log/httpd/error_log and /var/log/php-fpm/www-error.log.
  • "Directory is not writable" in the pre-installation check although the ownership is correct: the SELinux label is missing. Re-run the semanage and restorecon commands from step 3 and check for denials with sudo ausearch -m avc -ts recent.
  • Uploads of large survey archives fail: raise post_max_size and upload_max_filesize in /etc/php.d/99-limesurvey.ini and restart php-fpm.

Backups and upgrades

Back up the database and the LimeSurvey directory before every upgrade and on a regular schedule:

sudo mariadb-dump limesurvey | gzip > ~/limesurvey-$(date +%F).sql.gz
sudo tar -czf ~/limesurvey-files-$(date +%F).tar.gz -C /var/www limesurvey

For a manual upgrade the LimeSurvey manual describes this order: log out of the administration, back up, delete the old files except application/config/config.php, application/config/security.php and the upload directory, copy the files of the new package into place, then open the admin page and confirm the database upgrade when prompted. Do not lose security.php: it holds the key for all encrypted data. After copying new files, repeat the ownership and restorecon commands from step 3. Upgrades across major versions (5 to 6, 6 to 7) have their own instructions in the manual.

Frequently asked questions

Should I install LimeSurvey 6 or 7?

Install 7 on a new server. The 6.x packages are still offered for download, but that line passed its end-of-support date on 31 August 2026.

Can I use PostgreSQL instead of MariaDB?

Yes, PostgreSQL 14 or newer is supported. Install php-pgsql instead of php-mysqlnd, make the LimeSurvey user the owner of its database, and select PostgreSQL in the installer. On a RHEL 9 compatible system the default PostgreSQL is 13, so enable a newer module stream first.

What is different on Debian or Ubuntu?

The web server user is www-data instead of apache, the packages are named apache2, libapache2-mod-php and php-mysql, and there is no SELinux labelling step. Check that the distribution's PHP version is within the range LimeSurvey 7 supports (8.2.27 or newer, tested up to 8.5 according to the manual).

Why is bounce tracking unavailable?

Bounce processing needs the PHP IMAP extension, which is optional and not part of the PHP packages installed here. The LimeSurvey installation manual notes that from PHP 8.4 the extension has to be installed separately from PECL.

Share story:

Continue reading other guides on How VPS.