Easy Setup


Run the following command and follow the on-screen instructions.

/bin/bash -c "$(curl -fsSL https://beluga.social/setup/install.sh)"

Make sure you are using Debian 11.



Manual Setup


This tutorial will help you set a very simple Linux web server that will be capable of hosting a Beluga Feed.

To keep things simple and free we will use Digital Ocean, but this will work on any cloud server hosting provider. You can use my Digital Ocean referral link to get a $100 credit.

One final note before diving in. Beluga will work with simpler server setups. I decided to create this tutorial because a lot of beta testers decided to go this route and encountered problems along the way. Alternatively you can open a hosting account on traditional web hosting service like GoDaddy, DreamHost, BlueHost or the cheapest one that I have found NearlyFreeSpeech.net.

All these providers will give you simple managed web hosting and SFTP access which is all Beluga needs. The advantage with these kind of service is that you don't have to manage, monitor or update servers.

😎 On to the tutorial.

Create a Droplet

On the Digital Ocean website create a droplet with the following configuration.

Distribution: Debian 11
Plan: Basic
CPU Options: Regular with SSD $5/mo
Region: New York - 3
Authentication: SSH Key if you have one, you can also choose password to make things easy.
Additional Options: Enable Backups if you intend to use this server for real. Choose a hostname: Your hostname Eg. beluga.yourdomain.com. On this tutorial we will use belugademo.beluga.social.

SSH to Server

Connect to the server using SSH. The username will be root and you will use the IP address provided by Digital Ocean.

ssh [email protected]

Update Server Software

To make sure everything is up to date and secure on the server you should update all software.

apt-get update && apt-get upgrade -y

Install Needed Software

We need to a web server to be able to host our feed and media but we will also add more software to secure the server.

apt-get install -y fail2ban ufw nginx

Configure and Enable ufw

UFW is a very simple firewall that will help us secure the server.

ufw allow 22 ufw allow 80 ufw allow 443 ufw allow enable

Create a User

In order to connect to the server from the Beluga app we need an unprivileged user, let't create it.

adduser whale

Create a directory to store the files we want to serve with Nginx.

mkdir /home/whale/public

Make sure the directory has the correct permissions.

chown whale:whale /home/whale/public

Configure SSH

The Beluga app uses password authentication to connect to the server. By default Debian will not allow password authentication with SSH so we need to change that setting.

nano /etc/ssh/sshd_config

Find the line PasswordAuthentication and make sure that looks exactly like this.

PasswordAuthentication yes

Save the file and restart the SSH server

systemctl restart ssh

Configure Nginx

Now we will need to create a configuration for our HTTP server. Let' start by creating a configuration, for the file name we can use the hostname of our website.

nano /etc/nginx/sites-available/belugademo.beluga.social

On that file we will add the following configuration.

server {   listen 80;   server_name belugademo.beluga.social;   root /home/whale/public;   location / {     try_files $uri $uri/ =404;   } }

Save the file and create a symlink to the sites-enabled directory.

ln -s /etc/nginx/sites-available/belugademo.beluga.social /etc/nginx/sites-enabled/

Now let's restart Nginx to reload the configuration

systemctl restart nginx

Configure you DNS

Now you will have to go to your DNS provider and point the belugademo hostname to the IP provided by Digital Ocean.

Your must create an A-Record and point it to the IP of the Digital Ocean droplet.

TLS/SSL Configuration

Beluga requires that all feed use TLS/SSL to communicate. At this point you have two options. Install and configure Let's Encrypt or use a DNS provider like CloudFlare to simplify the TLS/SSL configuration

For this tutorial we went with the CloudFlare option. You just have to make sure that TLS is enabled on CloudFlare and make sure you choose the Flexible mode to get everything working.

Test your Setup

At this point everything should be working correctly. So, let's do a test.

Use an SFTP client like Cyberduck to connect to the server using your whale user. Once connected upload an image file or a index.html file with some content.

If you navigate on your browser to the hostname of the server and append the file name to the URL you should be able to see the file from the browser. That confirms everything is working

For example if your hostname is belugademo.beluga.social and you uploaded photo.jpeg you should be able to navigate to https://belugademo.beluga.social/photo.jpeg and see the photo.

Configure the App

Now you must configure the app to use this server.

Website: Your hostname in this tutorial we used belugademo.beluga.social but yours will be different.
Hostname: IP Address provided by Digital Ocean.
Username: whale is what we used on this tutorial.
Password: password used when creating the user.
Path: /home/whale/public is the path we used on this tutorial.

That's It

Let me know how the tutorial works for you.

- Gio