Elgg is a powerful open-source social networking engine that enables users to create their own social networks and online communities. It’s highly customizable, making it a great choice for developers and users looking to build interactive websites.
In this guide, we will go through the entire process of installing Elgg on your Ubuntu server.
Step 1: Install Required Dependencies
First, start by updating your system to make sure all existing packages are up to date to their latest versions.
sudo apt update -y sudo apt upgrade -y
Next, you need to install Apache (a web server), MySQL (a database server), PHP (the scripting language), and some PHP extensions to run Elgg properly on the server.
sudo apt install apache2 mysql-server php php-mysql php-xml php-mbstring php-zip php-gd php-curl php-json php-cli -y
After installing MySQL, you need to secure it by running the following security script, which will allow you to set up a root password and remove anonymous users.
sudo mysql_secure_installation
Next, we need to set up a MySQL database and user for Elgg.
sudo mysql -u root -p CREATE DATABASE elgg_db; CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON elgg_db.* TO 'your_username'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 2: Installing Elgg in Ubuntu
Now let’s download the latest version from the official Elgg download page or use the following wget command to download directly in the Apache web root directory.
cd /var/www/html/ wget https://elgg.org/download/elgg-6.0.5.zip
After downloading, unzip the file and rename the unzipped folder to the elgg
directory:
sudo unzip elgg-6.0.5.zip sudo mv elgg-6.0.5 elgg
Set the correct permissions for the Elgg
directory to function correctly.
sudo mkdir /var/www/html/data sudo chown -R www-data:www-data /var/www/html/data/ sudo chown -R www-data:www-data /var/www/html/elgg sudo chmod -R 755 /var/www/html/elgg
Step 3: Configure Apache for Elgg
Create a new Apache configuration file to serve the Elgg application.
sudo nano /etc/apache2/sites-available/elgg.conf
Add the following configuration into the file (replace example.com
with your actual domain):
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/elgg ServerName example.com <Directory /var/www/html/elgg> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Next, you need to enable the new site, and required modules and restart the Apache service to apply changes:
sudo a2ensite elgg.conf sudo a2enmod rewrite sudo systemctl restart apache2
Step 4: Complete Elgg Installation via Web Interface
Now that everything is set up, open your web browser and navigate to http://localhost/elgg
to complete the installation through the web interface.
Once you complete these steps, click on “Go to site” to access your newly installed Elgg platform.
Step 5: Elgg Post-Installation Setup
After installing Elgg, you should perform a few post-installation tasks:
For security reasons, it’s a good practice to remove the installation directory.
sudo rm -rf /var/www/elgg/installer
To secure your site, you can set up SSL using Let’s Encrypt.
sudo apt install certbot python3-certbot-apache -y sudo certbot --apache
Follow the prompts to secure your site with SSL.
Now you can access your Elgg site through https by going to your domain name or IP address in your web browser.
https://localhost/elgg
You have successfully installed Elgg on Ubuntu, now you can use this powerful platform to create social networks tailored to your needs. You can now explore its features, customize it further, and start building your online community.
I have already made an social networking site using elgg from xampp on windows 7. Now how to upload it? Please help me.
Hi there, First I am not a coder, never tried. So I thought I can try Elgg. I am trying to install elgg on XAMPP, I have Mac. I am receiving some Exception error. I tried MAMP and i receive same error I think its related to Mac permission somewhere. Can anyone please suggest me what to do? I am very upset because I am very new to all this.
Many thanks in advance.
@Sonu,
I don’t think these instructions works on XAMPP with Mac OS, better try on Linux systems, or search for XAMPP related elgg documentation at their official site..
Please I need your help. I’m new to elgg and I’m trying to install version 1.21. I have tried several things and yet it does not pass the rewrite test. I’ve looked up the installation guide on elgg but it has not helped too. I’m using a Macbook and running xampp. Thanks
@Tolu,
Can you please tell me the error you facing, so that I can help you out..
Great ! Thank you
how to add the own html page as the index page.
It’s working fine now. Thanks.
I’m getting this error after all the steps.
Fatal Error.
An unrecoverable error has occurred and has been logged. Contact the site administrator with the following information:
Exception #1398146272
That override issue is not resolving
there are 3 types of override in http.conf and 2 of them are set to NONE
set them too to ‘All’ and check again.
What do you mean it’s integrated with Mediawiki? I cannot find a current plugin that does that.
Hi,
I tried to install elgg, in a subfolder of my website. I named the subfolder as “ncc” and have extracted all the files from the folder elgg to my subfolder “ncc”.
When I try to install by going to my url ncc.yourgoal.in/install.php I get an error as mentioned below.
“Web server
We think your server is running the Apache web server.
The rewrite test failed and the most likely cause is that AllowOverride is not set to All for Elgg’s directory. This prevents Apache from processing the .htaccess file which contains the rewrite rules.
A less likely cause is Apache is configured with an alias for your Elgg directory and you need to set the RewriteBase in your .htaccess. There are further instructions in the .htaccess file in your Elgg directory.”
I have checked the .htaccess file but couldn’t understand what I have to do there. Please help me on how to install elgg
In Apache httpd.conf file, change “AllowOverride None” to “AllowOverride All” and restart Apache service, it will fix this issue.
Great post! I folloed it step by step and it worked perfectly.
Just one thing you also have to install php mbstring
sudo yum install php-mbstring
No need of, it’s optional.