How to Install Socioboard on Ubuntu 20.04 – Social Media Lead Generation Toolkit

This tutorial will be showing you how to install Socioboard on Ubuntu 20.04 with Apache or Nginx web server. Socioboard is an open-source, self-hosted social media lead generation toolkit for businesses. Socioboard provides hosted service, but if you like to self-host the software on your own server, you can follow the instructions below.

Socioboard Features

Social networks are meant for the users, not for businesses. Socioboard views social from a business point of view and fills those gaps which social networks cannot fill exquisitely. Businesses should own their social data and they should be in charge of what they want to do with it, generate reports and analyze data to make informed and improved business decisions.

Socioboard provides:

  • Highly customizable and scalable open-source tools
  • Prompt feeds and interactive social discovery tools
  • Social CRM tools including shared customer records
  • Highly efficient team collaboration tools
  • Advanced scheduling & publishing tools
  • Sophisticated analytics on various parameters
  • Customer support features like tasks and Helpdesk integration

Prerequisites

First, you need a Linux server with at least 2GB RAM. You can click this special link to get $100 free credit on DigitalOcean. (For new users only). If you are already a DigitalOcean user, then you can click this special link to get $50 free credit on Vultr (for new users only). Once you have an account at DigitalOcean or Vultr, install Ubuntu 20.04 on your server and follow the instructions below.

Socioboard requires PHP and MySQL/MariaDB. To follow this tutorial, you should have already set up a LAMP stack or LEMP stack. If you haven’t already done so, please use one of the following guides.

You also need a domain name. I registered my domain name at NameCheap because the price is low and they give whois privacy protection free for life.

Now let’s install Socioboard.

Step 1: Download Socioboard on Ubuntu 20.04 Server

Log in to your Ubuntu 20.04 server via SSH. Then run the following command to download the latest version of Socioboard onto your server.

sudo apt install git

git clone https://github.com/socioboard/Socioboard-4.0.git

Once downloaded, move the files to the /var/www/ directory.

sudo mkdir -p /var/www/

sudo mv Socioboard-4.0 /var/www/socioboard

Then we need to grant permissions to the www-data user so that the web server can write to this directory.

sudo setfacl -R -m u:www-data:rwx /var/www/socioboard/

Step 2: Install Node.js

The Socioboard backend is built on Node.js, which is a JavaScript run-time environment that translates human-readable JavaScript code into machine code, so we need to install Node.js on Ubuntu 20.04 in order to run Socioboard. This tutorial will install the LTS release of Node.js (V12.x) from the NodeSource repository.

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

sudo apt install -y nodejs

The nodejs package contains the npm (Node.js package manager) binary, so there’s no need to install it separately. To check your Node.js and npm version, run

node -v

npm -v

Output:

socioboard nodejs ubuntu 20.04

Step 3: Install Node Packages

First, install the nodemon, sequalize, and mysql2 package in global mode.

sudo npm install nodemon sequelize-cli sequelize mysql2 -g

In the /var/www/socioboard/socioboard-api/ directory, there are 5 sub-directories.

  • feeds
  • library
  • notification
  • publish
  • user

We need to go to each of these sub-directories and install dependency packages. For example, go to the feeds sub-directory.

cd /var/www/socioboard/socioboard-api/feeds

And install dependency packages, which will be placed in the node_modules directory.

npm install

If there are vulnerabilities found, run the following command to fix the vulnerabilities.

npm audit fix

Now do the same in the other 4 sub-directories.

Step 4: Create a Database and User in MariaDB

Log into MariaDB database server with the following command.

sudo mysql

Then create a database for Socioboard. This tutorial names the database socioboard. You can use whatever name you like.

create database socioboard;

Create the database user. Again, you can use your preferred name for this user. Replace your_password with your preferred password.

create user socioboard@localhost identified by 'your_password';

Grant this user all privileges on the socioboard database.

grant all privileges on socioboard.* to socioboard@localhost;

Flush privileges and exit.

flush privileges;

exit;

Step 5: Set Up MariaDB Database

Edit a file.

sudo nano /var/www/socioboard/socioboard-api/library/sequelize-cli/config/config.json

Enter the database name, username and password.

socioboard mariadb

Save and close the file. Then change directory.

cd /var/www/socioboard/socioboard-api/library/sequelize-cli/

Initialize the socioboard database.

NODE_ENV=development sequelize db:migrate

In the /var/www/socioboard/socioboard-api/library/sequelize-cli/seeders/ directory, there’s a file whose name ends with application_info.js. Run the following command.

NODE_ENV=development sequelize db:seed --seed 20190213051930-initialize_application_info.js

sociobard set up mariadb ubuntu 20.04

Step 6: Install MongoDB

MongoDB is a document-oriented NoSQL database program. Run the following command to import the MongoDB public GPG Key

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

Create a source list file for MongoDB.

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Update package index and install MongoDB.

sudo apt update

sudo apt install -y mongodb-org

Start MongoDB.

sudo systemctl start mongod

Enable auto-start at boot time.

sudo systemctl enable mongod

Check its status:

systemctl status mongod

Sample output:

 mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-08-03 17:39:42 HKT; 52s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 2710248 (mongod)
     Memory: 61.8M
     CGroup: /system.slice/mongod.service
             └─2710248 /usr/bin/mongod --config /etc/mongod.conf

As you can see, it’s active (running).

Step 7: Create a Database and User in MongoDB

Log into MongoDB shell.

mongo

Create a database for SocioBoard.

use socioboard

You need to insert at least one document into this database. Run the following command to insert an example document.

db.new_collection.insert({ some_key: "some_value" })

Then run the following command to create a user.

db.createUser(
  {
    user: "socioboard",
    pwd: "your_password",
    roles: [ { role: "readWrite", db: "socioboard" } ]
  }
)

Leave the MongoDB shell.

exit

Step 8: Set Up MongoDB Connection

Edit a file.

sudo nano /var/www/socioboard/socioboard-api/user/config/development.json

Enter the database name, username and password.

socioboard mongodb ubuntu 20.04

Scroll down to the end of the file and add the following 3 lines.

"base_path": "../../media",
"payment_path": "../../media/payments",
"template": "public/template/paymentTemplate.html"

socioboard user configs

Save and close the file. Then also edit the following 3 files and enter the MongoDB database name, username and password.

  • /var/www/socioboard/socioboard-api/feeds/config/development.json
  • /var/www/socioboard/socioboard-api/notification/config/development.json
  • /var/www/socioboard/socioboard-api/publish/config/development.json

Step 9: Run Socioboard Microservices

sudo nano /etc/systemd/system/socioboard-user.service

Add the following lines. Replace username with your real username.

[Unit]
Description=SocioBoard User Microservice
After=multi-user.target

[Service]
Type=simple
User=username
WorkingDirectory=/var/www/socioboard/socioboard-api/user/
Environment=NODE_ENV=development
ExecStart=/usr/bin/nodemon app.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Save and close the file.

sudo nano /etc/systemd/system/socioboard-publish.service

Add the following lines. Replace username with your real username.

[Unit]
Description=SocioBoard Publish Microservice
After=multi-user.target

[Service]
Type=simple
User=username
WorkingDirectory=/var/www/socioboard/socioboard-api/publish/
Environment=NODE_ENV=development
ExecStart=/usr/bin/nodemon app.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Save and close the file.

sudo nano /etc/systemd/system/socioboard-feeds.service

Add the following lines. Replace username with your real username.

[Unit]
Description=SocioBoard Feeds Microservice
After=multi-user.target

[Service]
Type=simple
User=username
WorkingDirectory=/var/www/socioboard/socioboard-api/feeds/
Environment=NODE_ENV=development
ExecStart=/usr/bin/nodemon app.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Save and close the file.

sudo nano /etc/systemd/system/socioboard-notification.service

Add the following lines. Replace username with your real username.

[Unit]
Description=SocioBoard Notification Microservice
After=multi-user.target

[Service]
Type=simple
User=username
WorkingDirectory=/var/www/socioboard/socioboard-api/notification/
Environment=NODE_ENV=development
ExecStart=/usr/bin/nodemon app.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Save and close the file. Then start the 4 services.

sudo systemctl start socioboard-user socioboard-publish socioboard-feeds socioboard-notification

Now you should check the status of each service.

systemctl status socioboard-user
systemctl status socioboard-publish
systemctl status socioboard-feeds
systemctl status socioboard-notification

For each service, if you see a message like

service listening on http://localhost:3000

Then the service is successfully started. If you don’t see this message, then there are errors and you can check the logs at the public/logs/ folder to see what’s wrong.

If all services have started successfully, then enable auto-start at boot time.

sudo systemctl enable socioboard-user socioboard-publish socioboard-feeds socioboard-notification

Step 10: Set Up Socioboard-web-php

Change directory.

cd /var/www/socioboard/socioboard-web-php/

Install Laravel.

sudo apt install composer 

composer global require laravel/installer

Rename the environmentfile.env to .env.

mv environmentfile.env .env

Edit this file.

nano .env

Enter the APP URL and API URLs. socioboard.example.com is the URL you will enter in the web browser address bar to access SocioBoard.

APP_URL=https://socioboard.exmaple.com/
API_URL=http://localhost:3000/
API_URL_PUBLISH=http://localhost:3001/
API_URL_FEEDs=http://localhost:3002/
API_URL_NOTIFY=http://localhost:3003/

Save and close the file. Then install PHP dependencies.

composer update

Next, generate a Laravel app key, which will be saved in the .env file.

php artisan key:generate

Step 11: Setting Up Web Server

We can use Apache or Nginx web server.

Apache

If you prefer Apache, create a virtual host file for Socioboard.

sudo nano /etc/apache2/sites-available/socioboard.conf

Put the following text into the file. Replace socioboard.example.com with your own sub-domain for Socioboard. Don’t forget to set A record for the domain name in your DNS manager.

<VirtualHost *:80>
    ServerName socioboard.example.com
    DocumentRoot /var/www/socioboard/socioboard-web-php/public/

    <Directory /var/www/socioboard/socioboard-web-php/public/>
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/socioboard.error.log
    CustomLog ${APACHE_LOG_DIR}/socioboard.access.log combined

</VirtualHost>

Save and close the file. Then enable this virtual host.

sudo a2ensite socioboard.conf

We need to enable the rewrite module.

sudo a2enmod rewrite

Restart Apache for the changes to take effect.

sudo systemctl restart apache2

Nginx

If you prefer Nginx, create a virtual host file for Socioboard.

sudo nano /etc/nginx/conf.d/socioboard.conf

Put the following text into the file. Replace socioboard.example.com with your own sub-domain for Socioboard. Don’t forget to set A record for the domain name in your DNS manager.

server {
  listen 80;
  listen [::]:80;
  server_name socioboard.example.com;
  root /var/www/socioboard/socioboard-web-php/public/;
  index index.php index.html index.htm index.nginx-debian.html;

  error_log /var/log/nginx/socioboard.error;

  location / {
    try_files $uri $uri/ /index.php;
  }

  error_page 404 /404.html;
  error_page 500 502 503 504 /50x.html;

  client_max_body_size 2M;

  location = /50x.html {
    root /usr/share/nginx/html;
  }

  location ~ \.php$ {
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    include snippets/fastcgi-php.conf;
  }

  #enable gzip compression
  gzip on;
  gzip_vary on;
  gzip_min_length 1000;
  gzip_comp_level 5;
  gzip_types application/json text/css application/x-javascript application/javascript image/svg+xml;
  gzip_proxied any;

  # A long browser cache lifetime can speed up repeat visits to your page
  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
       access_log        off;
       log_not_found     off;
       expires           360d;
  }

  # disable access to hidden files
  location ~ /\.ht {
      access_log off;
      log_not_found off;
      deny all;
  }
}

Save and close the file. Then test Nginx configuration.

sudo nginx -t

If the test is successful, reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Step 12: Enabling HTTPS

To encrypt the HTTP traffic, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Ubuntu 20.04 server.

sudo apt install certbot

If you use Nginx, then you also need to install the Certbot Nginx plugin.

sudo apt install python3-certbot-nginx

Next, run the following command to obtain and install TLS certificate.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d socioboard.yourdomain.com

If you use Apache, install the Certbot Apache plugin.

sudo apt install python3-certbot-apache

And run this command to obtain and install TLS certificate.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d socioboard.yourdomain.com

Where

  • --nginx: Use the nginx plugin.
  • --apache: Use the Apache plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

The certificate should now be obtained and automatically installed.

socioboard https ubuntu 20.04

Step 13: Use Socioboard

Now you can access the SocioBoard web interface at https://socioboard.example.com. You need to create an account in order to use it. If you can’t create account, check the error logs in /var/www/socioboard/socioboard-web-php/storage/logs/ directory.

socioboard login

Socioboard will try to send a verification email to you, but I found it can’t send emails. To activate your account, you can change the activation status from the MariaDB database. Log into MariaDB shell.

sudo mysql

Use the socioboard database.

use socioboard;

Then activate your account.

update user_activations set activation_status = 1;

By default, your account is under the Basic plan, you can change to the Platinum plan.

update user_activations set user_plan = 7;

Leave the MariaDB shell.

exit

Then log into your SocioBoard account.

socioboard dashboard

Conclusion

I hope this tutorial helped you install Socioboard on Ubuntu 20.04 server. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial
[Total: 2 Average: 5]

3 Responses to “How to Install Socioboard on Ubuntu 20.04 – Social Media Lead Generation Toolkit

  • Hi, love your tutorials and this site! Keep it up!

    I am having some trouble with this install. When I run
    NODE_ENV=development sequelize db:seed –seed 20190213051930-initialize_application_info.js
    command, I get the following error…

    ERROR: Cannot find "/var/www/socioboard/socioboard-api/library/sequelize-cli/seeders/config/config.json". Have you run "sequelize init"?

    I run the sequelize init command and get the following error.

    Loaded configuration file "config/config.json".
    Using environment "development".
    ERROR: Access denied for user 'root'@'localhost'

    There is a new config/config.json file which I update the db information for development for but after the command still fails…

    • Figured it out. The NODE_ENV=development sequelize db:seed –seed 20190213051930-initialize_application_info.js command needs to be ran in the /var/www/socioboard/socioboard-api/library/sequelize-cli/ directory, not the /var/www/socioboard/socioboard-api/library/sequelize-cli/seeders/ directory as I was doing.

  • Mahendra
    4 weeks ago

    Hi, I tried installing socioboard on ubuntu 18 using this article, everything seems installed but when I check user microservice, it just displays following info and I can’t register an user from front end.
    ubuntu@ip:/var/www/socioboard/socioboard-api/user$ nodemon app.js

    [nodemon] 2.0.4
    [nodemon] to restart at any time, enter `rs`
    [nodemon] watching path(s): *.*
    [nodemon] watching extensions: js,mjs,json
    [nodemon] starting `node app.js`

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.


The maximum upload file size: 2 MB.
You can upload: image.