Production Database Setup
To change a database from the default database SQLite, you need to install database software that you want to use in the production stage (e.g., PostgreSQL). You also need to do the initial setup for the database.
Note: Most actions from this lesson onwards must be done on the Ubuntu instance. Make sure that you are connected to the remote server via SSH.
1. Install PostgreSQL on the instance
Based on the PosgtreSQL official documentation, you can install PostgreSQL in the following steps.
1. Create the file repository configuration
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
2. Import the repository signing key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
3. Update the package lists
sudo apt-get update
4. Install the latest version of PostgreSQL
sudo apt-get -y install postgresql
Subscribe now for
uninterrupted access.