โ† Back to LimeSurvey

How to Deploy & Use LimeSurvey

LimeSurvey Deployment & Usage Guide

1. Prerequisites

Before installing LimeSurvey, ensure your server meets the following requirements:

Web Server:

  • Apache โ‰ฅ 2.4
  • nginx โ‰ฅ 1.1
  • Or any PHP-ready web server

PHP:

  • PHP โ‰ฅ 7.4 with the following extensions:
    • mbstring
    • PDO drivers (for database connectivity)
    • Recommended additional extensions: gd2, imap, ldap, zip, zlib

Database (choose one):

  • MySQL โ‰ฅ 8.0
  • PostgreSQL โ‰ฅ 12
  • MariaDB โ‰ฅ 10.3.38
  • MSSQL โ‰ฅ 2016

Recommended Setup:

  • Latest nginx version
  • Latest PHP version with php-fpm
  • Latest MariaDB or MySQL version

Tools:

  • Git (for cloning the repository)
  • Composer (PHP dependency manager)
  • Web server with SSL/TLS support for production

2. Installation

Download LimeSurvey

Option 1: Stable Release (Recommended) Download the latest stable version from the official community site:

wget https://community.limesurvey.org/downloads/latest-stable-release.zip
unzip latest-stable-release.zip
mv limesurvey /var/www/html/

Option 2: Git Repository (Development) Clone the repository for the latest development version:

git clone https://github.com/LimeSurvey/LimeSurvey.git
cd LimeSurvey

File Permissions

Set appropriate permissions for the LimeSurvey directory:

chown -R www-data:www-data /var/www/html/limesurvey/
chmod -R 755 /var/www/html/limesurvey/
chmod -R 775 /var/www/html/limesurvey/upload/
chmod -R 775 /var/www/html/limesurvey/tmp/
chmod -R 775 /var/www/html/limesurvey/application/config/

Database Setup

  1. Create a database for LimeSurvey:
CREATE DATABASE limesurvey CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'limesurvey_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON limesurvey.* TO 'limesurvey_user'@'localhost';
FLUSH PRIVILEGES;
  1. For PostgreSQL:
CREATE DATABASE limesurvey;
CREATE USER limesurvey_user WITH PASSWORD 'strong_password';
GRANT ALL PRIVILEGES ON DATABASE limesurvey TO limesurvey_user;

3. Configuration

Web Server Configuration

Apache Configuration:

<VirtualHost *:80>
    ServerName surveys.yourdomain.com
    DocumentRoot /var/www/html/limesurvey/
    
    <Directory /var/www/html/limesurvey/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/limesurvey_error.log
    CustomLog ${APACHE_LOG_DIR}/limesurvey_access.log combined
</VirtualHost>

nginx Configuration:

server {
    listen 80;
    server_name surveys.yourdomain.com;
    root /var/www/html/limesurvey;
    index index.php;
    
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    
    location ~ /\.ht {
        deny all;
    }
}

PHP Configuration

Edit your php.ini file with these recommended settings:

max_execution_time = 300
max_input_time = 300
memory_limit = 256M
post_max_size = 128M
upload_max_filesize = 128M
date.timezone = "Your/Timezone"

LimeSurvey Configuration

  1. Navigate to your LimeSurvey installation in a web browser

  2. The installation wizard will guide you through:

    • License agreement acceptance
    • Database configuration (host, name, user, password)
    • Administrator account creation
    • Optional plugin installation
  3. After installation, configure application/config/config.php for production:

'urlFormat' => 'path',
'showScriptName' => false,
'useSSL' => true, // Enable for HTTPS

4. Build & Run

Development Environment

LimeSurvey is a PHP application that doesn't require traditional building. For development:

  1. Set up a local development environment:
# Using Docker (if available)
docker-compose up -d

# Or set up manually with XAMPP/WAMP/MAMP
  1. Enable debug mode in application/config/config.php:
'debug' => true,
'debugsql' => false, // Set to true for SQL debugging
  1. Access the development site:
http://localhost/limesurvey/admin

Production Setup

  1. Disable debug mode:
'debug' => false,
  1. Set secure permissions:
chmod 644 /var/www/html/limesurvey/application/config/config.php
  1. Configure cron jobs for regular tasks:
# Add to crontab (run every 5 minutes)
*/5 * * * * php /var/www/html/limesurvey/application/commands/console.php cron >/dev/null 2>&1

5. Deployment

Self-Hosted Deployment Options

Traditional VPS/Dedicated Server:

  • DigitalOcean, Linode, Vultr, or AWS EC2
  • Install LEMP/LAMP stack as per prerequisites
  • Follow installation steps above
  • Configure SSL with Let's Encrypt

Docker Deployment: Create a docker-compose.yml:

version: '3'
services:
  db:
    image: mariadb:10.5
    environment:
      MYSQL_ROOT_PASSWORD: root_password
      MYSQL_DATABASE: limesurvey
      MYSQL_USER: limesurvey
      MYSQL_PASSWORD: limesurvey_password
    volumes:
      - db_data:/var/lib/mysql
  
  web:
    image: limesurvey/limesurvey:latest
    ports:
      - "80:80"
      - "443:443"
    environment:
      DB_HOST: db
      DB_NAME: limesurvey
      DB_USER: limesurvey
      DB_PASSWORD: limesurvey_password
    depends_on:
      - db
    volumes:
      - upload_data:/var/www/html/upload
      - application_data:/var/www/html/application/config

volumes:
  db_data:
  upload_data:
  application_data:

Managed Hosting (No Self-Hosting): LimeSurvey offers a hosted SaaS solution if you prefer not to manage infrastructure:

Deployment Checklist

  • SSL/TLS certificate installed and configured
  • Database backups scheduled
  • File permissions secured
  • Debug mode disabled
  • Regular update process established
  • Monitoring configured (server resources, uptime)

6. Troubleshooting

Common Issues & Solutions

Issue: White screen or blank page

# Check PHP error log
tail -f /var/log/php/error.log

# Enable error reporting in config.php
'debug' => true,

Issue: Database connection errors

  • Verify database credentials in application/config/config.php
  • Ensure database user has proper permissions
  • Check if database server is running

Issue: File upload problems

# Check PHP upload limits
php -i | grep upload

# Verify directory permissions
ls -la /var/www/html/limesurvey/upload/

Issue: Slow performance

  • Enable PHP opcache
  • Configure database query caching
  • Use a CDN for static assets
  • Consider Redis or Memcached for session storage

Issue: Plugin installation fails

  • Check PHP zip extension is enabled
  • Verify write permissions to upload/ and tmp/ directories
  • Check server can connect to LimeSurvey plugin repository

Issue: Survey not loading properly

  • Clear browser cache
  • Check JavaScript console for errors
  • Verify CKEditor assets are loading (check assets/packages/ckeditor/)

Getting Help

Regular Maintenance

  1. Backups:
# Database backup
mysqldump -u username -p limesurvey > limesurvey_backup_$(date +%Y%m%d).sql

# File backup
tar -czf limesurvey_files_$(date +%Y%m%d).tar.gz /var/www/html/limesurvey/
  1. Updates:
  • Always backup before updating
  • Check compatibility with your PHP version
  • Test updates in a staging environment first
  • Follow official update guides at https://www.limesurvey.org/manual
  1. Security:
  • Keep PHP and database server updated
  • Regularly review user accounts and permissions
  • Monitor access logs for suspicious activity
  • Use two-factor authentication for admin accounts