How To Install Elgg on Debian 13

Elgg is a powerful open-source social networking framework that enables you to create custom social networks, community platforms, and intranets. Built with PHP and MySQL, this versatile platform offers robust features including user management, activity streams, groups, file sharing, and customizable widgets. Installing Elgg on Debian 13 provides a stable, secure foundation for your social networking project. This comprehensive guide walks you through every step of the installation process, from setting up the LAMP stack to configuring your Elgg instance. Whether you’re building an internal company network, an educational community, or a public social platform, you’ll have a fully functional Elgg installation by the end of this tutorial.
What is Elgg?
Elgg is an award-winning social networking engine written in PHP that runs on MySQL or MariaDB databases. The platform has been actively developed since 2004 and powers thousands of social networks worldwide. It provides a flexible framework that allows developers and site administrators to create unique social experiences tailored to their specific needs.
The core functionality includes user profiles, friend connections, activity feeds, group creation, blogging, file uploads, and messaging systems. Elgg’s plugin architecture enables extensive customization, allowing you to add features like forums, calendars, event management, and more. The platform is particularly popular in educational institutions, non-profit organizations, and businesses seeking private social networking solutions.
One of Elgg’s strongest advantages is its focus on privacy and data ownership. Unlike commercial social networks, you maintain complete control over your data and can customize privacy settings to meet your organization’s requirements. The active community continuously develops new themes and plugins, ensuring the platform evolves with changing needs.
Prerequisites and System Requirements
Before beginning the installation, ensure your environment meets the necessary requirements. You’ll need a Debian 13 server with root or sudo administrative privileges. A domain name configured to point to your server’s IP address is recommended for production environments, though you can use an IP address for testing purposes.
Basic familiarity with Linux command line operations will help you navigate this tutorial more effectively. According to official documentation, Elgg requires specific software versions for optimal performance. Your server should run PHP 8.1 or higher with essential extensions including GD, XML, mbstring, and JSON support. The database backend requires MySQL 5.7 or newer, or MariaDB 10.3 or later.
Apache 2.4 or higher serves as the recommended web server, with mod_rewrite enabled for clean URLs. Hardware-wise, allocate at least 2GB of RAM and 20GB of disk space, though requirements increase with user growth. For production environments, consider 4GB RAM or more to handle concurrent users effectively.
An SSL certificate is highly recommended for securing data transmission, especially if handling sensitive information. You can obtain free certificates through Let’s Encrypt, which we’ll cover in later steps.
Step 1: Update Debian 13 System
System updates are critical for security and compatibility. Begin by connecting to your Debian 13 server via SSH. Execute the following command to refresh the package repository index:
sudo apt update
This command synchronizes the package index with the latest versions available in Debian repositories. Next, upgrade all installed packages to their newest versions:
sudo apt upgrade -y
The -y flag automatically confirms the upgrade without manual intervention. Install essential utilities that will be needed throughout the installation process:
sudo apt install wget unzip curl software-properties-common -y
These tools enable file downloads, archive extraction, and repository management. If kernel updates were applied during the upgrade, reboot your system to ensure all changes take effect:
sudo reboot
After rebooting, reconnect to your server to continue the installation.
Step 2: Install Apache Web Server
Apache serves as the web server that will deliver your Elgg installation to users’ browsers. Install Apache using Debian’s package manager:
sudo apt install apache2 -y
Once installation completes, start the Apache service and configure it to launch automatically on system boot:
sudo systemctl start apache2
sudo systemctl enable apache2
Verify that Apache is running correctly by checking its status:
sudo systemctl status apache2
You should see “active (running)” in the output. Configure the firewall to allow HTTP and HTTPS traffic. If using UFW (Uncomplicated Firewall), execute:
sudo ufw allow 'Apache Full'
Test your Apache installation by opening a web browser and navigating to your server’s IP address. You should see the default Apache welcome page, confirming successful installation. Apache will serve as the foundation for hosting your Elgg social network, handling all HTTP requests and delivering dynamic content generated by PHP.
Step 3: Install PHP and Required Extensions
Elgg requires PHP with multiple extensions to function properly. Install PHP along with all necessary modules using a single command:
sudo apt install php php-fpm php-mysql php-gd php-xml php-mbstring php-curl php-zip php-json php-xmlrpc php-opcache libapache2-mod-php -y
Each extension serves a specific purpose. The php-mysql extension enables database connectivity. The php-gd library handles image processing for user avatars and uploaded photos. The php-xml and php-mbstring modules support international characters and XML parsing. The php-curl extension allows external API communications, while php-zip manages compressed file uploads.
Verify your PHP installation by checking the version:
php -v
You should see PHP 8.1 or higher. Configure PHP settings to accommodate Elgg’s requirements. Open the PHP configuration file:
sudo nano /etc/php/8.1/apache2/php.ini
Adjust the following values to support larger file uploads and adequate memory allocation:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300
These settings allow users to upload files up to 64MB and provide sufficient memory for Elgg operations. Save the file and restart Apache to apply the changes:
sudo systemctl restart apache2
Step 4: Install and Configure MariaDB Database Server
MariaDB serves as the database backend for storing all Elgg data including user information, posts, and site configuration. Install MariaDB server:
sudo apt install mariadb-server -y
Start the MariaDB service and enable it to run at boot:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Secure your MariaDB installation by running the security script:
sudo mysql_secure_installation
The script prompts several security questions. Press Enter at the first prompt about the current root password (if none is set). Choose “Y” to set a root password and create a strong password. Answer “Y” to remove anonymous users, disallow root login remotely, remove the test database, and reload privilege tables. These measures significantly improve database security.
Verify that MariaDB is running properly:
sudo systemctl status mariadb
The output should indicate an active status.
Step 5: Create Elgg Database and User
Create a dedicated database and user account for Elgg. Log into the MariaDB console as root:
sudo mysql -u root -p
Enter the root password you set earlier. At the MariaDB prompt, create a new database:
CREATE DATABASE elggdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
The UTF8MB4 character set ensures full Unicode support, including emojis. Create a database user with a strong password:
CREATE USER 'elgguser'@'localhost' IDENTIFIED BY 'your_strong_password';
Replace your_strong_password with a complex password combining letters, numbers, and special characters. Grant all privileges on the Elgg database to this user:
GRANT ALL PRIVILEGES ON elggdb.* TO 'elgguser'@'localhost';
Flush privileges to ensure the changes take effect immediately:
FLUSH PRIVILEGES;
Exit the MariaDB console:
EXIT;
Store these credentials securely as you’ll need them during the web-based installation. Following the principle of least privilege, this dedicated user has access only to the Elgg database, enhancing security.
Step 6: Download and Extract Elgg
Navigate to the web root directory where you’ll install Elgg:
cd /var/www/
Download the latest stable Elgg release from the official GitHub repository:
sudo wget https://github.com/Elgg/Elgg/archive/refs/heads/master.zip
Extract the downloaded archive:
sudo unzip master.zip
Rename the extracted directory for easier management:
sudo mv Elgg-master elgg
Create a separate data directory outside the web root for enhanced security. This directory stores user-uploaded files and should not be directly accessible via the web:
sudo mkdir /var/elgg-data
Set proper ownership for both directories to the Apache user:
sudo chown -R www-data:www-data /var/www/elgg
sudo chown -R www-data:www-data /var/elgg-data
Configure appropriate permissions:
sudo chmod -R 755 /var/www/elgg
sudo chmod -R 755 /var/elgg-data
These permissions allow the web server to read and execute files while maintaining security. The separate data directory prevents direct web access to uploaded content, which could pose security risks.
Step 7: Configure Apache Virtual Host for Elgg
Create a new Apache virtual host configuration file for your Elgg installation:
sudo nano /etc/apache2/sites-available/elgg.conf
Add the following configuration, replacing yourdomain.com with your actual domain:
<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/elgg
<Directory /var/www/elgg>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/elgg-error.log
CustomLog ${APACHE_LOG_DIR}/elgg-access.log combined
</VirtualHost>
The AllowOverride All directive enables .htaccess files, which Elgg uses for URL rewriting. Save and close the file. Enable the new virtual host configuration:
sudo a2ensite elgg.conf
Optionally disable the default Apache site:
sudo a2dissite 000-default.conf
Enable the Apache rewrite module, essential for Elgg’s clean URLs:
sudo a2enmod rewrite
Test the Apache configuration for syntax errors:
sudo apache2ctl configtest
If you see “Syntax OK,” restart Apache to apply all changes:
sudo systemctl restart apache2
Step 8: Configure SSL Certificate with Let’s Encrypt
Securing your Elgg installation with HTTPS protects user data and improves search engine rankings. Install Certbot and the Apache plugin:
sudo apt install certbot python3-certbot-apache -y
Obtain an SSL certificate for your domain:
sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
Replace yourdomain.com with your actual domain. Certbot prompts for an email address for renewal notifications and asks you to agree to the terms of service. When asked about redirecting HTTP to HTTPS, choose option 2 to redirect all traffic automatically.
Certbot automatically configures Apache and obtains the certificate. Verify the SSL installation by visiting your domain with HTTPS in a browser. Test automatic renewal:
sudo certbot renew --dry-run
Certbot automatically sets up a cron job for renewal, ensuring your certificate stays valid. SSL certificates from Let’s Encrypt are valid for 90 days and renew automatically.
Step 9: Complete Elgg Installation via Web Interface
Access your Elgg installation through a web browser by navigating to your domain. The installation wizard appears automatically on first access. The first screen displays the installation requirements check, verifying that all necessary PHP extensions and server configurations are present. Green checkmarks indicate successful configuration.

Click “Next” to proceed to database configuration. Enter the database details you created earlier:
- Database Host: localhost
- Database Name: elggdb
- Database User: elgguser
- Database Password: your_strong_password
Specify the data directory path as /var/elgg-data. Enter your site URL, using https:// if you configured SSL. Click “Next” to continue.
Configure your site settings by entering a descriptive site name and brief description. Provide your email address for administrative notifications. Create your administrator account by choosing a username and secure password. Remember these credentials as they provide full access to your Elgg installation.
Review the installation summary to ensure all information is correct. Click “Install” to begin the installation process. Elgg creates necessary database tables and configures the system. When installation completes successfully, you’ll see a success message. Click “Go to site” to access your new social networking platform.
Step 10: Post-Installation Configuration and Security
Log into your Elgg administrative dashboard using the credentials you created. Navigate to the administration panel from the account menu. Configure basic site settings including time zone, language, and default access levels.
Set up email notifications by configuring SMTP settings under “Settings > Email Settings”. Proper email configuration enables user registration confirmations, password resets, and notification delivery. Enter your SMTP server details, port, authentication credentials, and sender information.
Configure cron jobs to automate scheduled tasks. Add the following line to your server’s crontab:
*/5 * * * * /usr/bin/php /var/www/elgg/elgg-cli cron -v
This executes Elgg’s cron handler every five minutes, processing scheduled tasks like email notifications and content cleanup. Adjust user registration settings under “Configure > Users” to control who can create accounts. Options include open registration, approval-required registration, or invitation-only access.
Install essential plugins from the Elgg plugin directory to extend functionality. Popular additions include advanced forums, event calendars, and social bookmarking tools. Enable installed plugins through the administration panel under “Configure > Plugins.”
Implement regular backup procedures for both the database and file storage. Create automated scripts to back up the MariaDB database:
mysqldump -u elgguser -p elggdb > elgg_backup_$(date +%Y%m%d).sql
Back up the data directory using rsync or similar tools. Store backups in a secure, off-site location.
Common Troubleshooting Tips
Database connection errors typically indicate incorrect credentials or insufficient privileges. Verify the database name, username, and password in your configuration. Ensure the database user has all necessary privileges on the Elgg database.
Permission-related issues prevent file uploads or plugin installations. Check that the web server user (www-data) owns the Elgg and data directories. Verify directory permissions are set to 755 and file permissions to 644.
If clean URLs aren’t working, verify that mod_rewrite is enabled and the virtual host configuration includes AllowOverride All. Check that the .htaccess file exists in your Elgg root directory.
Missing PHP extensions cause various functionality problems. Review the requirements check in the installation wizard and install any missing extensions using apt. Restart Apache after installing PHP modules.
Memory limit and execution time errors occur when processing large files or complex operations. Increase the values in your php.ini file as outlined earlier. For persistent issues, consider upgrading your server resources.
SSL certificate problems often relate to mixed content warnings. Ensure all resources load via HTTPS and update any hardcoded HTTP URLs in your database. Check Apache error logs at /var/log/apache2/elgg-error.log for detailed error information. These logs provide valuable debugging information when issues arise.
Congratulations! You have successfully installed Elgg. Thanks for using this tutorial for installing Elgg open source community platform on Debian 13 “Trixie” system. For additional help or useful information, we recommend you check the official Elgg website.