Construct a non-public social community with a Raspberry Pi

Social networks have revolutionized individuals’s lives within the final a number of years. Folks use social channels daily to remain linked with family and friends. However a typical query stays relating to privateness and knowledge safety. Even when social networks have created advanced privateness insurance policies to guard customers, sustaining your knowledge in your individual server is all the time the most suitable choice when you do not need to make them accessible to the general public.

Once more, a Raspberry Pi—Raspbian Lite model may be very versatile that will help you put plenty of helpful dwelling companies (see additionally my

Raspberry Pi initiatives

article) in place. Some addictive options may be achieved by looking for open supply software program and testing it with this improbable gadget. An fascinating instance to attempt is putting in OpenSource Social Community in your Raspberry Pi.

OpenSource Social Community (OSSN) is a rapid-development social networking software program written in PHP, that primarily means that you can make a social networking web site. OSSN can be utilized to construct several types of social apps, corresponding to:

  • Non-public Intranets
  • Public/Open Networks
  • Neighborhood

OSSN helps options like:

  • Photographs
  • Profile
  • Mates
  • Smileys
  • Search
  • Chat

OSSN runs on a LAMP server. It has very poor {hardware} necessities, however an incredible person interface, which can also be mobile-friendly.

What we’d like

This venture may be very easy and, as a result of we’re putting in solely distant net companies, we solely want just a few low cost elements. I’ll use a Raspberry Pi Three mannequin B+, however it also needs to work with Raspberry Pi Three mannequin A+ or newer boards.


  • Raspberry Pi Three mannequin B+ with its energy provide
  • a micro SD card (higher if it’s a performing card, no less than 16GB)
  • a Desktop PC with an SFTP software program (for instance, the free Filezilla) to switch set up packages into your RPI.

Step-by-step process

We’ll begin by organising a traditional LAMP server. We’ll then arrange database customers and set up OpenSource Social Community.

1. Set up Raspbian Buster Lite OS

For this step, you may merely observe my Set up Raspbian Buster Lite in your Raspberry Pi article.

Be sure that your system is updated. Join by way of ssh terminal and sort following instructions:

sudo apt-get replace
sudo apt-get improve

2. Set up LAMP server

LAMP (Linux–Apache–Mysql–Php) servers often include the MySQL database. In our venture, we’ll use MariaDB as a substitute, as a result of it’s lighter and works with Raspberry Pi.

3. Set up Apache server:

sudo apt-get set up apache2 -y

You must now be capable of examine that Apache set up has gone appropriately by looking http://<<YouRpiIPAddress>>:

4. Set up PHP:

sudo apt-get set up php -y

5. Set up MariaDB server and PHP connector:

sudo apt-get set up mariadb-server php-mysql -y

6. Set up PhpMyAdmin:

PhpMyAdmin is just not obligatory in OpenSource Social Community, however I recommend that you simply set up it as a result of it simplifies database administration.

sudo apt-get set up phpmyadmin

Within the phpMyAdmin setup display, take the next steps:

  • Choose apache (obligatory) with area and press OK.
  • Choose Sure to configure the database for phpMyAdmin with dbconfig-common.
  • Enter your favourite phpMyAdmin password and press OK.
  • Enter your phpMyAdmin password once more to substantiate and press OK

7. Grant phpMyAdmin person DB privileges to handle DBs:

We’ll hook up with MariaDB with root person (default password is empty) to grant permissions. Bear in mind to make use of semicolons on the finish of every command row as proven under:

sudo mysql -uroot -p
grant all privileges on *.* to ‘phpmyadmin’@’localhost’;
flush privileges;
give up

8. Lastly, restart Apache service:

sudo systemctl restart apache2.service

And examine that phpMyAdmin is working by looking http://<<YouRpiIPAddress>>/phpmyadmin/.

Default phpMyAdmin login credentials are:

  • person: phpmyadmin
  • password: the one you arrange within the phpMyAdmin set up step

Putting in different open supply social network-required packages and organising PHP

We have to put together our system for OpenSource Social Community’s first setup wizard. Required packages are:

  • PHP model any of 5.6, 7.0, 7.1
  • MYSQL 5 OR >
  • PHP Extensions cURL & Mcrypt must be enabled
  • PHP GD Extension
  • PHP ZIP Extension
  • PHP settings allow_url_fopen enabled
  • PHP JSON Help
  • PHP XML Help
  • PHP OpenSSL

So we’ll set up them with following terminal instructions:

sudo apt-get set up php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml


sudo a2enmod rewrite

2. Edit default Apache config to make use of mod_rewrite:

sudo nano /and many others/apache2/sites-available/000-default.conf

3. Add the part in order that your 000-default.conf file seems like the next (excluding feedback):

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog $/error.log
CustomLog $/entry.log mixed
# SECTION TO ADD ——————————–
<Listing /var/www/html>
Choices Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
# END SECTION TO ADD ——————————–

4. Set up Mcrypt:

sudo apt set up php-dev libmcrypt-dev php-pear
sudo pecl channel-update pecl.php.internet
sudo pecl set up mcrypt-1.0.2

5. Allow Mcrypt module by including (or uncommenting) “” in “/and many others/php/7.3/apache2/php.ini”:

sudo nano /and many others/php/7.3/apache2/php.ini

allow_url_fopen must be already enabled in “/and many others/php/7.3/apache2/php.ini”. OpenSSL must be already put in in php7.3.

6. One other setting that I recommend is enhancing the PHP max add file dimension as much as 16 MB:

sudo nano /and many others/php/7.3/apache2/php.ini

7. Search for the row with the upload_max_filesize parameter and set it as the next:

upload_max_filesize = 16M

8. Save and exit. Restart Apache:

sudo systemctl restart apache2.service

Set up OSSN

1. Create DB and arrange person:

Return to phpmyadmin net web page (browse “http://<<YourRpiIPAddress>>/phpmyadmin/”) and login:

Consumer: phpmyadmin

Password: the one arrange in phpmyadmin set up step

Click on on database tab:

Create a database and be aware of the database identify, as you may be required to enter it later within the set up course of.

It is time to create a database person for OSSN. On this instance, I will use the next credentials:

Consumer: ossn_db_user

Password: ossn_db_password

So, terminal instructions can be (root password remains to be empty, if not modified by you earlier than):

sudo mysql -uroot -p
CREATE USER ‘ossn_db_user’@’localhost’ IDENTIFIED BY ‘ossn_db_password’;
GRANT ALL PRIVILEGES ON ossn_db.* TO ‘ossn_db_user’@’localhost’;
flush privileges;
give up

2. Set up OSSN software program:

Obtain the OSSN set up zip file from the OSSN obtain web page in your native PC. On the time of this writing, this file is known as “”

Utilizing your favourite SFTP software program, switch your complete zip file by way of SFTP to a brand new folder within the path “/dwelling/pi/obtain” in your Raspberry Pi. Widespread (default) SFP connection parameters are:

  • Host: your Raspberry Pi IP handle
  • Consumer: pi
  • Password: raspberry (when you did not change the pi default password)
  • Port: 22

Again to terminal:

cd /dwelling/pi/obtain/ #Enter listing the place OSSN set up information have been transferred
unzip #Extracts all information from zip
cd /var/www/html/ #Enter Apache net listing
sudo rm index.html #Removes Apache default web page – we’ll use OSSN one
sudo cp -R /dwelling/pi/obtain/ossn-v5.2-1577836800/* ./ #Copy set up information to net listing
sudo chown -R www-data:www-data ./

Create an information folder:OSSN requires a folder to retailer knowledge. OSSN suggests, for safety causes, to create this folder exterior of the revealed doc root. So, we’ll create this opt-in folder and provides grants:

sudo mkdir /choose/ossn_data
sudo chown -R www-data:www-data /choose/ossn_data/

Browse http://<<YourRpiIPAddress>> to begin the set up wizard:

All checks must be wonderful. Click on the Subsequent button on the finish of the web page.

Learn the license validation and click on the Subsequent button on the finish of the web page to simply accept.

Enter the database person, password, and the DB identify you selected. Bear in mind additionally to enter the OSSN knowledge folder. Press Set up.

Enter your admin account data and press the Create button.

All the things must be wonderful now. Press End to entry the administration dashboard.

So, administration panel may be reached with URL “http://<<YourRpiIPAddress>>/administrator” whereas person hyperlink can be “http://<<YourRpiIPAddress>>”.

This text was initially revealed at Reposted with permission.


Germany Devoted Server

Leave a Reply