open source * free culture
... and other musings ...


by Tobias Luther

How to install Hubzilla on Debian "Stretch" 9 in seven easy steps

Installing my favorite web suite aka Hubzilla on the forthcoming Debian 9 "Stretch" is a joy. Quick, straightforward and easy. I will show you how to do it in about 10 minutes or less.
What you will need:
  • Debian 9 basic installation (only deviation in my install was including "basic" and SSH-server)
  • Existing domain, correctly configured and pointing to your server

All right then, let's start the Hubzilla installation party.
  • The Basics: Install the required dependencies:
    apt-get install vim git apache2 mariadb-server php certbot python-certbot-apache php-curl php-gd php-mbstring php-xml php-mysql php-zip
  • Webserver apache: Create vhost file /etc/apache2/sites-available/hubzilla.conf and enable vhost, enable the required apache module rewrite
    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName my-hubzilla.site
        DocumentRoot /var/www/hubzilla
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        </Directory>
        <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/hubzilla_error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/hubzilla_access.log combined
    </VirtualHost>

    Enable the new vhost
    enable /etc/apache2/sites-available/hubzilla.conf
    Enable apache modules rewrite
    a2enmod rewrite
    Restart apache2 in order to activate all these changes
    systemctl restart apache2
  • Download Hubzilla: clone the Hubzilla Git repository and chown everything to be writable to the webserver account www-data
    cd /var/www/ ; git clone https://github.com/redmatrix/hubzilla ; chown -R www-data. hubzilla;
  • create the database
    mysql -u root
    create database hubzilla ; CREATE USER 'hubzilla'@'localhost' IDENTIFIED BY 'totally-secret-password'; GRANT ALL PRIVILEGES ON hubzilla.* to 'hubzilla'@'localhost';
  • SSL Encryption: create the letscencrypt certificates in order to use SSL and have certbot automatically configure your apache vhost to use SSL. Just follow the instructions. Let certbot configure your vhost to use SSL.
    certbot
  • setup a cronjob
    echo "*/10 * * * *    cd /var/www/hubzilla; /usr/bin/php Zotlabs/Daemon/Master.php Cron"  >> /etc/crontab
  • Finally: open your browser and follow the instructions.
    https://my-hubzilla.site