For this recipe, we need a specific version of postgres. It is not mandatory for you to download and install the postgres version that will be used. The reason is that, some developers might have an already configured postgres database version with data, and having multiple servers running within a computer might cause issues later.
To overcome this problem, we will make use of a docker container. A container could be defined as a lightweight instantiation of a software application that is isolated from other containers and your computer host. Similar to a virtual machine, you could have multiple versions of your software stored inside your host, and start multiple containers whenever necessary.
First, we will download docker from https://docs.docker.com/install/ and install the Community Edition (CE) version. Then, we will pull an already precompiled docker image. Start a Terminal and run the following command:
$ docker pull shongololo/postgis
This docker image has PostgreSQL 10 with Postgis 2.4 and SFCGAL plugin. Now we need to start an instance given the image. An important part corresponds to the -p 5433:5432. These arguments maps every connection and request that is received at port 5433 in your host (local) computer to the 5432 port of your container:
$ docker run --name parallel -p 5433:5432 -v <SHP_PATH>:/data shongololo/postgis
Now, you can connect to your PostgreSQL container:
$ docker exec -it parallel /bin/bash
root@d842288536c9:/# psql -U postgres
psql (10.1)
Type "help" for help.
postgres=#
Where root and d842288536c9 corresponds to your container username and group respectively.