After creating the instance, you can start directly with Lightsail's terminal or use Lightsail's terminal access from your local machine.
To open your Lightsail instance, follow these steps:
- Download the SSH key from Lightsail.
- Open your terminal and paste the following command to move the key file to the
.ssh
folder:cp ~/Downloads/private_key.pem ~/.ssh/
- Paste the following command to edit the SSH configuration file:
sudo nano ~/.ssh/config
- Add the following lines to your
config
file:Host lightsail-instance HostName your_ipv4_address User bitnami IdentityFile ~/.ssh/private_key.pem
That's it! Now you can access the Lightsail terminal from your PC's terminal by entering the command:
ssh lightsail-instance
First, update the package list and upgrade installed packages:
sudo apt update && sudo apt upgrade -y
Run the following commands to install and start Nginx:
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
If Nginx doesn't start due to port issues, edit the default configuration file to change the port from 80 to 8080:
sudo nano /etc/nginx/sites-available/default
In this case, we are using PostgreSQL. Follow these steps to install it:
-
Run the following command to install PostgreSQL:
sudo apt install postgresql postgresql-contrib -y
-
Start and enable PostgreSQL:
sudo systemctl start postgresql sudo systemctl enable postgresql