Build a private social network with a Raspberry Pi

Step-by-step instructions on how to create your own social network with low-cost hardware and simple setup.

Subscribe now

Get the highlights in your inbox every week.

Social networks have revolutionized people's lives in the last several years. People use social channels every day to stay connected with friends and family. But a common question remains regarding privacy and data security. Even if social networks have created complex privacy policies to protect users, maintaining your data in your own server is always the best option if you don't want to make them available to the public.

Again, a Raspberry Pi—Raspbian Lite version can be very versatile to help you put a number of useful home services (see also my Raspberry Pi projects article) in place. Some addictive features can be achieved by searching for open source software and testing it with this fantastic device. An interesting example to try is installing OpenSource Social Network in your Raspberry Pi.

What Is OpenSource Social Network?

OpenSource Social Network (OSSN) is a rapid-development social networking software written in PHP, that essentially allows you to make a social networking website. OSSN can be used to build different types of social apps, such as:

Private Intranets

Public/Open Networks

Community

OSSN supports features like:

Photos

Profile

Friends

Smileys

Search

Chat

OSSN runs on a LAMP server. It has very poor hardware requirements, but an amazing user interface, which is also mobile-friendly.

What we need

This project is very simple and, because we're installing only remote web services, we only need a few cheap parts. I'm going to use a Raspberry Pi 3 model B+, but it should also work with Raspberry Pi 3 model A+ or newer boards.

Hardware:

Raspberry Pi 3 model B+ with its power supply

a micro SD card (better if it is a performing card, at least 16GB)

a Desktop PC with an SFTP software (for example, the free Filezilla) to transfer installation packages into your RPI.

Step-by-step procedure

We'll start by setting up a classic LAMP server. We'll then set up database users and install OpenSource Social Network.

Create a data folder:OSSN requires a folder to store data. OSSN suggests, for security reasons, to create this folder outside of the published document root. So, we'll create this opt-in folder and give grants:

Hi MF,
I'm a Docker lover too! But tyranwyn/ossn image is based on linux/amd64, while Raspberry PI is an arm based architecture. You can try, but hardly will work on PI... If you want to make it running in Docker on Raspberry PI you should create a custom image from apache injecting ossn package and linking it to a MariaDB image (both arm based).

Despite its title, "OpenSource Social Network" is not clearly "Open Source" as most of us define it. In short this is because they have crafted a unique license and have not submitted it to the OSI for assessment.

We are small team and focused on development. We are not lawyers so its bit hard for us to decide which license to use, we were using GPL in the past but change to our custom license. The code is for open source purpose but we wanted to preserve our credits

1. We wanted to preserve copyrights
2. We wanted to preserver powered by notice

That is the goal we created our custom license, if any license suited this please let us know, we are open for discussion and happy to change to OSI approved license.

- First line connect you to mysql terminal console. Default password is empty (so, simply press ENTER key).
- Second line create the user for OSSN (setted up only for local connection and with the defined password)
- Third line gives all permissions to your DB user only inside the created database
- Fourth line make these changes running (if you don't flush priviledges these will not be running/committed)
- Fifth line closes mysql terminal console

I'm sorry I haven't replied to your helpful comment until now. I had forgotten that I'd posted my query here and thought that I'd posted it on the forum where the original installation instructions were posted, and was waiting a reply from there!

I ended up by reinstalling the system and it then went all OK. However on testing the Open Source Social Network site I'd created, I find that I can't invite people to join by email. The problem is that there is no mail server installed on the Pi, so it looks like that I've got to install one - which appears to be a non-trivial task.

Did you install a mail server on your Pi and if so, do you have any advice, please?

I'm sorry I haven't replied to your helpful comment until now. I had forgotten that I'd posted my query here and thought that I'd posted it on the forum where the original installation instructions were posted, and was waiting a reply from there!

I ended up by reinstalling the system and it then went all OK. However on testing the Open Source Social Network site I'd created, I find that I can't invite people to join by email. The problem is that there is no mail server installed on the Pi, so it looks like that I've got to install one - which appears to be a non-trivial task.

Did you install a mail server on your Pi and if so, do you have any advice, please?

Hi jokre07,
your note is correct. Anymore, you must use a Windows PC to flash Raspberry PI OS and to remotely control a headless installation like the one I used (Raspberry PI has poor hardware, so avoiding Desktop environment help performances).
I prefer using windows because I don't know if OSSN has a directory for latest build, so downloading it from web page should assure having latest version

Nice article but the software doesn't work it is full of problems and doesn't install cleanly.
I sort it out the not being able to detect the existence of mod rewrite on an Amazon instance then the next step I filled in all the required fields and clicked install only to get "All fields are required!"
I'd advise people not to waste their time.

Hi Anthony. This guide is about a local installation in Raspberry PI. It is correctly working with Raspberry PI 3 Model B+.
If you tried an AWS installation, maybe you should look for proper guide. I can only suggest to ask OSSN for AWS installation guide.
If you don't respect requirements identified by this guide, of course it could be not working...

Hi Giuseppe.
I've installed the system, but I can only access it from the LAN, not WAN. I port forwarded port 80 to the LAN address of the Pi and I see that the Apache access log shows that the request gets through - but that as far as it gets.
(I tried registering with this site last week, but have not yet received a confirmation email.)
Jim

If you installed it from a local address and you want then use it from external domain, please remember to update accordingly to it /var/www/html/configurations/ossn.config.site.php file ($Ossn->url parameter).

Footer

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat.

Opensource.com aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. Red Hat and the Red Hat logo are trademarks of Red Hat, Inc., registered in the United States and other countries.