Installing GNU Social with SSL on Debian 7 Wheezy

Yesterday I got my instance of GNU Social up and running on a Debian 7 server and I thought to document the steps I took in order to have a functional GNU Social instance.

First make sure you have the GLAMP (GNU/Linux Apache MySQL PHP) stack installed, with php 5.5 or higher.

nano /etc/apt/sources.list

Then add the following lines:

deb wheezy-php55 all
deb-src wheezy-php55 all

save and run the following:

apt-key add dotdeb.gpg

Then install the packages:

apt-get update
apt-get install apache2 php5 php5-mysql php5-gd php5-curl php5-intl mysql-server git sendmail-bin

Now it’s time to create a database and a user for our GNU Social instance.
Log in to mysql server:

mysql -u root -p

And execute the following SQL query:

GRANT ALL ON gnusocial.* to 'gnusocial' IDENTIFIED BY 'your_password_here';

Now download GNU Social and place it in /var/www/gnusocial

git clone /var/www/gnusocial

Then give the user www-data ownership to the gnusocial folder:

chown -R www-data:www-data /var/www/gnusocial

Now let’s create an apache2 virtual host for our instance

touch /etc/apache2/sites-available/gnusocial

and edit the configuration to match our installation

nano /etc/apache2/sites-available/gnusocial
<VirtualHost *:80>
  DocumentRoot /var/www/gnusocial
  DirectoryIndex index.php

And activate the php module and the site with the following commands

a2enmod php5
a2ensite gnusocial
service apache2 reload

Now you can try to access your website domain (e.g. and you will see a page that informs you that you need to make a configuration file and start the installer.
Before continuing the GNU Social installation we are going to enable fancy URLs and SSL
In order to enable Fancy URLs we have to use the provided .htaccess file

mv /var/www/gnusocial/htaccess.sample /var/www/gnusocial/.htaccess

In order to have SSL encryption we will use a Let’s Encrypt certificate generated by their automated script.
So let’s go to work.

cd ~
git clone letsencrypt
cd letsencrypt
./letsencrypt-auto --help

Now run the following command and follow on-screen wizard to install the Let’s encrypt certificates.

./letsencrypt-auto --apache

If it complains about outdated libaugeas0 and augeas-lenses you can download and install the packages from jessie (I assune you’re runing on a X86_64 installation, otherwise just find the links on :

cd ~
dpkg -i *.deb

Then run again :

./letsencrypt-auto --apache

Now after all these steps are followed you can proceed with the GNU Social installation wizard by visiting the GNU Social installation page (e.g.

After that you may want to change the theme of GNU Social to neo-quitter by adding the following line to the config.php

$config['site']['theme'] = 'neo-quitter';

If you would like to follow me on GNU Social, please do so at the following address:


5 thoughts on “Installing GNU Social with SSL on Debian 7 Wheezy”

  1. Daniel, I really like your straight forward approach to installing GNU Social and the easy to follow steps you have described in this guide.

    May I suggest the following:

    — using the GLAMP term instead of LAMP? It stands for GNU/Linux+Apache+MySQL+PHP

    — providing the address of your GNU Social profile so people reading your guide can follow you? It’s true it’s easy to guess (subdomain social dot this domain), but a link would help people avoid the guess work and it would help you get more people watching your work.

    — using MariaDB instead of MySQL? MariaDB is the nonprofit project which continues the libre version of MySQL prior to acquisition by Oracle.

    — using Trisquel as server instead of Debian? It’s a stable , FSF-endorsed fully libre distro based on Ubuntu and Debian.

    Oh, I almost forgot: thanks for telling me about!

    Excellent guide, I will recommend it to Ceata community in the hope it will inspire other people to have the courage to setup their own instance of GNU Social, because you make it look simple enough!

    Thanks :-)

    1. Thanks for your suggestions Tiberiu,
      I corrected the terminology as you suggested and I am looking to switch from Debian 7 to Debian 8, or maybe Trisquel 8 … it’s just hard to find a company providing Trisquel as a VPS choice. Please let me know if you know one.

      When I will make the switch I will definately use MariaDB instead of MySQL.

      1. Daniel, thank you for the update!

        For running a Trisquel virtual machine, maybe you don’t need the cooperation of the hosting company. The “trisquelize” script can transform from within an Ubuntu system into a Trisquel one with the corresponding version. I recommend migration from Ubuntu 14.04 to Trisquel 7, because it’s the latest version of Trisquel and it’s supported until 2019.

        Please note that best for software freedom and privacy is to have your own self-hosted mini computer as server. is working building such a hardware product.

        In the event you will try to use the trisquelize script, please let us, your blog readers, know if you have succeeded. Thanks!

        As for MariaDB, you can install it on any popular GNU system distribution. The foundation provides their own repositories, I’m not sure if MariaDB packages are provided by the system distributions.

        For the migration from MySQL to MariaDB, I found a version compatibility page and a migration tutorial:

        If you try to migrate from MySQL to MariaDB, please let us know how that worked. Thanks!

        1. Thanks a lot for your suggestions. I am not sure I can run the trisquelize script successfully on a VPS because as far as I know you can not change the kernel of an OpenVZ VPS, maybe I am able to do that on a KVM or XEN VPS instance. I need to do some digging before doing that and I will definitely document it if I am going to succeed.

          I know it is better to have the server physically in a place I control but for now it is just not feasible for me.

          Thanks for the tips for MariaDB.

          1. Thank you for your reply, Daniel! I think you are right about OpenVZ, because the guest operating system is only a container isolated inside the real operating system. Please let us know if you succeed to trisquelize Ubuntu in a KVM or XEN-based virtual machine.

Leave a Reply

Your email address will not be published. Required fields are marked *