Software Version
Ubuntu 16.04
nginx 1.10
PHP 7.0
PostgreSQL 9.5

System update and upgrade

Since we are going to install a lot of things it is recommended to update the package list to get the last version of those packages.

_$: apt update
_$: apt upgrade

Install nginx

_$: apt install nginx

Install PostgreSQL

_$: apt install postgresql

Install PHP

We will install both PHP and the package needed to connect to PostgreSQL databases from your PHP code. If you are going to connect to another database you will have to change that package accordingly (e.g. php7.0-mysql for MySQL).

_$: apt-get install php7.0
_$: apt-get install php7.0-pgsql

The php7.0 package will install the following packages:

  • php-common
  • php7.0-cli
  • php7.0-common
  • php7.0-fpm
  • php7.0-json
  • php7.0-opcache
  • php7.0-readline

but we will need some more PHP packages for nextcloud to run:

_$: apt install php7.0-curl php7.0-gd php7.0-mbstring php7.0-xml php7.0-zip