News

The latest updates about Superdesk

BACK TO BLOG OVERVIEW

How to Install Superdesk and Superdesk Publisher

A step-by step guide
A step-by step guide

We are happy to see that Superdesk Publisher, the next-generation digital publishing platform designed to be a native extension of Superdesk, has started to take off among members of our community.

Interested in trying it out for yourself? Or would you like to have a deeper understanding of how to set up Superdesk Publisher and Superdesk, either separately or together?

We have put together a detailed guide for a stand-alone installation of both products below.

How to Install Superdesk

Prerequisites:

  • VPS or dedicated server: min 2GB RAM, 4GB Free space

  • Ubuntu 16.04 server version installed

Superdesk can be installed using one command line script which can be found here.

Run command:

sudo apt-get install curl -y && curl -s https://raw.githubusercontent.com/takeit/superdesk-install/master/install | sudo bash

Note: If you see the following message:

The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. apt-get install python3-venv You may need to use sudo with that command. After installing the python3-venv package, recreate your virtual environment. Failing command: [‘/opt/superdesk/env/bin/python3’, ‘-Im’, ‘ensurepip’, ‘ — upgrade’, ‘ — default-pip’]

Run:

export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8"

and then again execute the command:

sudo apt-get install curl -y && curl -s https://raw.githubusercontent.com/takeit/superdesk-install/master/install | sudo bash

The above command will install all the required dependencies needed by Superdesk. Once this is done, the Superdesk will run on your server.

You will be able to access it via your browser: http://<ip_or_domain>

The default login credentials will be:

Username: admin Password: admin

How to Install Superdesk Publisher

Before starting the installation, make sure your server meets all the requirements listed below:

Prerequisites:

  • VPS or dedicated server: min 2GB RAM, 4GB Free space with Linux system installed, preferably Ubuntu.

  • PHP ≥ 7.1 with all the extensions (See here to read more about all extensions).

  • PostgreSQL ≥ 9.4.

  • Memcached.

  • Composer installed globally.

  • ElasticSearch ≥ 5.4 (version 5.4 or 5.6 preferably).

  • RabbitMQ ≥ 3.5.

  • Apache web server ≥ 2.4 or Nginx.

  • See here to read more about all requirements.

Note: In this guide the Superdesk Publisher will be installed on another server.

Setting up the server/VPS

1. Install ElasticSearch

ElasticSearch v5.6 will be used. Run the following command to install ES:

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.0.deb && sudo dpkg -i elasticsearch-5.6.0.deb && sudo apt-get -y update && sudo apt-get -y install --no-install-recommends openjdk-8-jre-headless && sudo systemctl enable elasticsearch && sudo systemctl restart elasticsearch

The ElasticSearch should be running on port 9200. You can run the command:

curl -s "http://localhost:9200"

to find out if everything is working.

2. Install PostgreSQL

Run command:

sudo apt-get install postgresql postgresql-contrib -y

The default PostgreSQL user is postgres.

Set the default PostgreSQL user password:

sudo -u postgres psql postgres \password postgres

Hit enter, and a prompt to type a new password will show up.

Type \q to exit the postgres console, once you type a new password.

3. Install PHP-FPM 7.2

Let’s install PHP-FPM 7.2 with all the required extensions:

sudo apt install software-properties-common sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php sudo apt update sudo apt install -y php7.2-fpm php7.2-pgsql php7.2-gd php7.2-xml php7.2-intl php7.2-zip php7.2-mbstring php7.2-curl php7.2-bcmath

4. Configure PHP-FPM 7.2

Run command:

cd /etc/php/7.2/fpm/pool.d/ && sudo curl -s -O https://gist.githubusercontent.com/takeit/2ee16ee50878eeab01a7ca11b69dec10/raw/e9eda2801ac3657495374fcb846c2ff101a3e070/www.conf && sudo service php7.2-fpm restart

5. Install Nginx server

Run command:

sudo apt-get -y install nginx

6. Configure Nginx server

Run command:

cd /etc/nginx/sites-enabled/ && sudo curl -s -O https://gist.githubusercontent.com/takeit/9c895b4d59930a9b550a43a0d26c0e0e/raw/bff973443d244929c8deda70f97b4ae862d9158b/default && sudo service nginx restart

7. Install RabbitMQ server

Run command:

sudo apt install -y rabbitmq-server

8. Install Supervisor

Run command:

sudo apt-get install -y supervisor

Completing the Superdesk Publisher installation

The Superdesk Publisher repository can be found on GitHub. From there the source code can be downloaded and the Superdesk Publisher can be installed on your server. Follow the guide below.

Assumed our server has 192.168.0.102 IP address. You can change it to your own IP or domain name. But in this guide we will use 192.168.0.102 IP for Superdesk Publisher instance.

Superdesk instance will run using 192.168.0.101 IP address.

1. Install Composer

cd ~/ curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

2. Download the source code

The default directory where the Publisher source code will be downloaded can be /var/www/publisher and all console commands need to be executed inside that directory starting from now on.

Run commands in your terminal:

cd /var/www/ && sudo git clone https://github.com/superdesk/web-publisher.git publisher

Install Superdesk Publisher source code dependencies:

HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1) && sudo chown -R "$HTTPDUSER":"$HTTPDUSER" publisher/ && cd publisher && sudo -u www-data SYMFONY_ENV=prod composer install --no-dev --optimize-autoloader

All the source code dependencies will start to install. Once it is done, you will be asked to fill the parameters.yml file which needs to be completed before proceeding.

If you don’t know what to set, simply use default values by hitting “enter” and replace the content of/var/www/publisher/app/config/parameters.yml file with:

To set proper permissions for cache and logs directories, run:

sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX app/cache app/logs && sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX app/cache app/logs

3. Check Requirements

Check if your server meets the requirements by running:

php app/check.php

If everything is in order, you should see this message: Your system is ready to run Symfony projects.

4. Create the Database and Update the Schema

Inside /var/www/publisher directory, run the command to create the database:

SYMFONY_ENV=prod php app/console doctrine:database:create

And populate the database with the schema, run:

SYMFONY_ENV=prod php app/console doctrine:migrations:migrate --no-interaction

5. Create organization:

SYMFONY_ENV=prod php app/console swp:organization:create Publisher

6. Create tenant:

SYMFONY_ENV=prod php app/console swp:tenant:create 192.168.0.102 TestingM

Where <organization_code> is the organization code generated by the previous command and 192.168.0.102 is your IP/domain name which points to the server where Superdesk Publisher is installed. Replace it with your appropriate data.

7. Install theme:

sudo -u www-data SYMFONY_ENV=prod php app/console swp:theme:install src/SWP/Bundle/FixturesBundle/Resources/themes/DefaultTheme/ -f --activate

<tenant_code> is the Tenant’s code generated by previous command. Replace it with the proper value.

Install theme assets:

sudo -u www-data SYMFONY_ENV=prod php app/console sylius:theme:assets:install

8. Run supervisor

sudo -u www-data SYMFONY_ENV=prod php app/console rabbitmq-supervisor:build --env=prod

The Superdesk Publisher should be running and be accessible using your remote server IP, 192.168.0.102 in this case.

9. Clear the cache

Run command:

SYMFONY_ENV=prod php app/console cache:clear --env=prod


How to Configure Superdesk Publisher with Superdesk

Now that the Superdesk and Superdesk Publisher applications are installed, it is possible to enable Superdesk Publisher Component inside the Superdesk UI.

Superdesk Publisher Component is a JavaScript component that is a separate dependency and can be included in Superdesk in order to manage Superdesk Publisher application.

The source code of this component can be found at GitHub.

1. Update Configuration File

Login to the server where Superdesk is installed.

Inside /opt/superdesk/client/dist directory on your server open the config.js and config.<hash>.js (e.g.config.23fr4.js) files and override the content with the text as below:

That’s it! Now, when you log in to Superdesk in the left hamburger menu, you will see the Superdesk Publisher menu item:

Superdesk Publisher Menu Item
Superdesk Publisher Menu Item

2. Configure Subscriber to Publish Content from Superdesk to Superdesk Publisher

You can read more about this here.

Thank you for reading to the end of this post! If you liked what you saw, please give us a pat on the back by starring our project on Github: https://github.com/superdesk/web-publisher.

BACK TO TOP

Sign up for free to our monthly newsletter to receive Software updates and news about Superdesk

Before you go

See Superdesk in action with a no-obligation demo for your organisation.

Schedule a demo