Self-Hosting LimeSurvey with Docker Compose

What Is LimeSurvey?

LimeSurvey is an open-source survey platform that’s been around since 2003 — one of the most mature self-hosted options in this space. It supports 30+ question types, conditional branching, quotas, multilingual surveys, and detailed statistical analysis. Self-hosting gives you complete control over survey data, which matters when you’re collecting sensitive information that shouldn’t live on someone else’s servers.

Prerequisites

  • A Linux server (Ubuntu 22.04+ recommended)
  • Docker and Docker Compose installed (guide)
  • 2 GB of free disk space
  • 1 GB of RAM (minimum)
  • A domain name (optional, for remote access)

Docker Compose Configuration

LimeSurvey doesn’t have an official Docker image. The community-maintained martialblog/limesurvey image is the standard choice — it’s actively maintained and tracks stable releases.

Create a docker-compose.yml file:

services:
  limesurvey:
    image: martialblog/limesurvey:6-apache
    container_name: limesurvey
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      # Database connection
      DB_TYPE: mysql
      DB_HOST: limesurvey-db
      DB_PORT: "3306"
      DB_NAME: limesurvey
      DB_USERNAME: limesurvey
      DB_PASSWORD: change-this-password        # CHANGE THIS
      DB_TABLE_PREFIX: lime_

      # Admin account (created on first start)
      ADMIN_USER: admin
      ADMIN_PASSWORD: change-this-too           # CHANGE THIS
      ADMIN_NAME: Administrator
      ADMIN_EMAIL: [email protected]
    volumes:
      - limesurvey-uploads:/var/www/html/upload
    depends_on:
      - limesurvey-db
    networks:
      - limesurvey

  limesurvey-db:
    image: mariadb:11.4
    container_name: limesurvey-db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: limesurvey
      MYSQL_USER: limesurvey
      MYSQL_PASSWORD: change-this-password      # Must match DB_PASSWORD above
      MYSQL_ROOT_PASSWORD: change-root-password  # CHANGE THIS
    volumes:
      - limesurvey-db:/var/lib/mysql
    networks:
      - limesurvey

volumes:
  limesurvey-uploads:
  limesurvey-db:

networks:
  limesurvey:
    driver: bridge

The image runs rootless as www-data on port 8080 by default — no need for privileged mode.

Start the stack:

docker compose up -d

Wait 30-60 seconds for the database initialization and schema creation. Access LimeSurvey at http://your-server-ip:8080.

Initial Setup

LimeSurvey auto-configures on first start using the environment variables. Log in with the ADMIN_USER and ADMIN_PASSWORD you set in the Compose file.

First things to configure in the admin panel:

  1. Global Settings → General: Set your site name, admin email, and default language
  2. Global Settings → Email: Configure SMTP for survey invitations and notifications
  3. Global Settings → Security: Review password policies and session settings
  4. Survey creation: Click “Create survey” to build your first survey

Configuration

SettingWherePurpose
ADMIN_EMAILEnvironment variableEmail for admin notifications
PUBLIC_URLEnvironment variablePublic-facing URL (set if behind reverse proxy)
URL_FORMATEnvironment variablepath for clean URLs, get for query strings
SHOW_SCRIPT_NAMEEnvironment variableSet false for cleaner URLs
TABLE_SESSIONEnvironment variableSet true to store sessions in database (useful for multi-server)
DEBUGEnvironment variableSet 1 or 2 for troubleshooting

For email sending, configure SMTP in the admin panel under Global Settings → Email Settings. LimeSurvey supports sending survey invitations, reminders, and confirmation emails.

PostgreSQL Alternative

If you prefer PostgreSQL over MariaDB:

services:
  limesurvey:
    image: martialblog/limesurvey:6-apache
    environment:
      DB_TYPE: pgsql
      DB_HOST: limesurvey-db
      DB_PORT: "5432"
      DB_NAME: limesurvey
      DB_USERNAME: limesurvey
      DB_PASSWORD: change-this-password
      ADMIN_USER: admin
      ADMIN_PASSWORD: change-this-too
      ADMIN_NAME: Administrator
      ADMIN_EMAIL: [email protected]
    # ... rest of config same as above

  limesurvey-db:
    image: postgres:17
    environment:
      POSTGRES_DB: limesurvey
      POSTGRES_USER: limesurvey
      POSTGRES_PASSWORD: change-this-password
    volumes:
      - limesurvey-db:/var/lib/postgresql/data

Reverse Proxy

LimeSurvey listens on port 8080. Point your reverse proxy to http://limesurvey:8080. Set the PUBLIC_URL environment variable to your external domain so generated survey links are correct.

For a dedicated reverse proxy setup, see Reverse Proxy Guide.

Backup

Back up two things:

  1. Database: Dump with docker exec limesurvey-db mariadb-dump -u limesurvey -p limesurvey > backup.sql
  2. Uploads volume: Contains survey attachments, themes, and plugins. Back up the limesurvey-uploads Docker volume.

For general backup strategies, see Backup Strategy.

Troubleshooting

Permission Errors on Upload Directory

Symptom: File uploads fail with permission denied errors.

Fix: The container runs as www-data (UID 33 on Debian). If you’re using bind mounts instead of named volumes, ensure the host directory is owned by UID 33:

sudo chown -R 33:33 /path/to/uploads

Database Connection Refused on First Start

Symptom: LimeSurvey shows “Database connection failed” immediately after docker compose up.

Fix: MariaDB takes 15-30 seconds to initialize on first start. Wait and reload. If it persists, verify that DB_PASSWORD matches MYSQL_PASSWORD exactly.

Survey URLs Return 404

Symptom: Survey links don’t work after setting up a reverse proxy.

Fix: Set the PUBLIC_URL environment variable to your external domain (e.g., https://survey.example.com). Also set URL_FORMAT=path and SHOW_SCRIPT_NAME=false for clean URLs.

Resource Requirements

  • RAM: ~256 MB idle, ~512 MB under moderate load
  • CPU: Low — single core handles most survey workloads
  • Disk: ~200 MB for the application, plus database storage and uploads

LimeSurvey is lightweight for what it does. A small VPS handles hundreds of concurrent survey respondents without issues.

Verdict

LimeSurvey is the most feature-complete self-hosted survey tool available. The 30+ question types, conditional logic, quotas, and built-in analytics make it suitable for anything from simple feedback forms to academic research surveys. The UI feels dated compared to modern alternatives like Formbricks, but the depth of functionality is unmatched.

Choose LimeSurvey if you need advanced survey logic, multilingual support, or compliance requirements that demand full data control. Choose Formbricks if you want a modern UX and simpler setup for basic forms and product surveys.

Comments