Download installation
Execute the following statement at the command line:
This command will help you to download the following PostgreSQL components:
`|`
-- | --
postgresql-client-10 | Client libraries and client binaries
postgresql-10 | Core Database Server
postgresql-contrib-9.x | Additional supplied modules (part of the POSTGRESQL-XX package in version and later)
Libpq-dev | Libraries and headers for C language frontend development
postgresql-server-dev-10 | Libraries and headers for C language backend development
Pgadmin4 | Pgadmin 4 Graphical Administration utility
User Configuration
Login to PostgreSQL via the following command:
sudo -u postgres psql
Enter the PostgreSQL command line view (you can see thepostgres=#prompt at the beginning), and then execute the following command to modify the Postgres user's password to "password":
ALTER USER postgres WITH PASSWORD ‘password‘;
Executes the\qcommand to eject the PostgreSQL command line.
You can set the password for the Postgre user in the command line interface with Superuser privileges:
Clear Password First:
sudo passwd -d postgres
In the Set password:
sudo -u postgre passwd
Follow the prompts and enter your new password two times.
Remote Login Configuration
Execute the following command:
Will
#listen_addresses = ‘localhost‘
Switch
listen_addresses = ‘*‘
(The comment was canceled, and the local access permission was changed to remote access)
Will
password_encryption = md5
Uncomment (the password will be transferred in encrypted mode, this step should not be required)
Restart Service:
sudo /etc/init.d/postgresql restart
Firewall settings for 5432 ports are allowed (the default port for PostgreSQL is 5432):
sudo iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5432 -j ACCEPT
Ubuntu 18.04 under PostgreSQL 10 installation and basic configuration