Install PostgreSQL 10 on Amazon EC2
Post Updated
In this tutorial, we will show you How to install PostgreSQL 10 on Amazon EC2. You will see how to Install PostgreSQL 10 on Amazon Linux is very easy and quick to install and use.
Amazon Linux 2 is the next generation of Amazon Linux, a Linux server operating system from Amazon Web Services (AWS). It provides a secure, stable, and high-performance execution environment to develop and run cloud and enterprise applications. With Amazon Linux 2, you get an application environment that offers long-term support with access to the latest innovations in the Linux ecosystem. Amazon Linux 2 is provided at no additional charge.
PostgreSQL, often simply Postgres, is an open-source object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance. It can handle workloads ranging from small single-machine applications to large Internet-facing applications (or for data warehousing) with many concurrent users. It is the default database on macOS Server and is available for Microsoft Windows and Linux (supplied in most distributions).
Read Also: How to install PostgreSQL 11 on Mac OS X via brew
Read Also: How to install PostgreSQL 10 on Debian 9
Step 1. Install PostgreSQL 10
Firstly we need to add the pgdg repository in Amazon Linux
amazon-linux-extras install postgresql10 vim epel -y
Step 2. Install PostgreSQL 10
yum install -y postgresql-server postgresql-devel
Create a new Postgres database cluster
/usr/bin/postgresql-setup --initdb
* Initializing database in '/var/lib/pgsql/data'
* Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
Step 4. Start the services of Postgres
Now execute the following command to start and enable the Postgres services.
systemctl enable postgresql
systemctl start postgresql
How to install postgresql 9.6 on Mac
Step 5. Login into Database
PostgreSQL installation is done. If you want to use the Database log in Postgres account by typing the following command
su - postgres
You can get into the Postgres console by typing
psql
Now use Postgres as you want to use it. To get the help use the \h command.
Read Also: Useful s3 commands
If you have any problem using this tutorial feel free to comment.