How to Install and Configure Hubzilla

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Hubzilla is an open source platform to create interconnected websites that feature a decentralized identity, communications and permissions framework built using webserver technology. Hubzilla provides decentralized network of hubs, which is called grid. Hubs are the servers which communicate with one another in order to propagate the information across grid. There is no single or central hub.

In this tutorial, I will be installing and setting up Hubzilla on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.


  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  3. Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  5. Set up your server’s hostname and create user with root privileges.

Setting Up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges.

You will need to install Git on your server. To install and configure Git, execute the command below.

(Optional) Now execute the commands below to configure Git by providing your name and valid email address so that commit messages may contain your correct information.

Install PHP

Paste requires installation of PHP 5.6 or newer version of PHP. In this tutorial, you will install PHP 7.2. To install PHP 7.2, execute the following steps.

First, you will need to install python software properties and software properties common. To do so, execute the command below.

You will need to add repository for newer versions of PHP. To do so, execute the commands below.

Then, update the system to refresh the available repositories. To do so, execute the command for updating Ubuntu system.

Let’s install PHP 7.2. To install PHP 7.2, execute the following command.

Hubzilla requires the following PHP extensions:

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-mbstring
  4. php7.2-gd
  5. php7.2-xml
  6. php7.2-mysql
  7. php7.2-curl
  8. php7.2-zip
  9. php7.2-json

To install the above extensions of PHP, execute the following command.

When you have done installation of the above extensions, apache2 will be installed automatically. Hence, you don’t need to install apache explicitly.

How to check confirm installation?

To check PHP installation, you can execute the following command to check installed PHP version.

Install MariaDB

Hubzilla supports MySQL and PostgreSQL. In this tutorial, you will use MariaDB server. By default, Ubuntu repository has older version of MariaDB server. To use new version of MariaDB, you will need to add MariaDB repository to your Ubuntu system. To do so, follow the steps below.

Verify the keys by executing command.

Add the repository using the command.

Update the system by using command.

Install MariaDB using the following command.

Start and enable the MariaDB server so that after reboot, the server can start automatically.

Run the following command to enhance security of MariaDB server and set password for the root user.

Connect to the MySQL shell as root user using the command below and enter your password.

Execute the following MySQL queries in your MariaDB server.

Install Hubzilla

To install Hubzilla, you will need to follow the steps.

Navigate to /var/www using the command.

Clone Hubzilla from Github using the command below.

Navigate to /hubzilla using the command.

Create directory for storing data of Hubzilla by executing command below.

Change rights for the directory created in the step above.

Install Hubzilla Addons

To clone and install Hubzilla addons, execute the following command.

Now provide ownership of /var/www/hubzilla to www-data so that Nginx server can access the required files.

Configure Apache Server

Let’s create virtual host configuration file for Hubzilla. Execute the following command, a file will be opened in nano text editor.

Copy and paste the following code and save the file.

Execute the command below to disable default site.

You will need to enable the newly created virtual host. To do so, execute the command below.

You will also need to enable rewrite mod. You can do so by editing configuration file in apache2 directory or you can simply execute the command below.

Now you will need to enable SSL engine. You can do so by editing configuration file in apache2 directory or you can simply execute the command below.

Restart apache server to apply the changes and load the settings by executing command below.

Now you can access Hubzilla via your domain name or ECS IP address. You will see the following screen.

Configure Database

When you click Next, you will be redirected to the following screen.

Add the database details and hit the Submit button. You will be redirected to following page. If you want to setup SSL then go to next section to install SSL and continue from here. Otherwise, fill in the details asked and hit Submit to continue.

After submission, you will see the following screen.

Here you go, you have successfully installed Hubzilla on your server.

Install SSL Certificate

To install SSL certificate using let’s encrypt, you will use Certbot. To do so, execute the following steps.

Update the package using command.

To install software-properties-common, execute the command below.

Add the certbot repository by using command below.

Update the package to load the added certbot repository using command.

Stop apache before issuance of SSL certificate.

Install python-certbot-apache using the command below.

Execute the following command to get let’s encrypt SSL issued.

Select the option 2 to redirect the link to https and update virtual host settings for SSL.

After successful issuance of SSL certificate, you will see the following screen.

Restart apache server.

Now you can access your website using https protocol. https://your_domain_name.tld

Set Up Firewalls for Required Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case, if you have forgotten to unblock these ports, you can follow the procedure below. By default, these ports are blocked by the firewalls.

If you are unsure how to set this up, visit the documentation page for Security Groups.


Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store