Amazon Linux 2003 Common Commands

OS Amazon Linux 2003

Install git

sudo yum install git

Install neofetch

git clone

sudo cp neofetch/neofetch /usr/bin/neofetch

rm -rf neofet


Install ngnix

sudo yum install nginx

sudo vi /etc/nginx/nginx.conf ->> Add site_name so cerbot can detect it

sudo systemctl start nginx.service

sudo systemctl status nginx.service

sudo systemctl enable nginx.service

Install certbot

sudo dnf install -y augeas-libs

sudo python3 -m venv /opt/certbot/

sudo /opt/certbot/bin/pip install --upgrade pip

sudo /opt/certbot/bin/pip install certbot

sudo /opt/certbot/bin/pip install certbot-nginx

sudo /opt/certbot/bin/certbot --nginx

Install cron and add autorenewal

sudo yum install cronie -y

sudo systemctl enable crond.service

crontab -e

0 12 * /opt/certbot/bin/certbot renew --quiet

Add swap

free -h

sudo swapon --show

df -h

sudo fallocate -l 4G /swapfile

ls -lh /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

sudo swapon --show

free -h

sudo cp /etc/fstab /etc/fstab.bak

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

free -h

Ignition gateway installation

Download installer

chmod +x


Install Postgres

sudo dnf install postgresql15 #client

sudo dnf install postgresql15-server #server

psql -V

sudo /usr/bin/postgresql-15-setup initdb

systemctl status postgresql

systemctl start postgresql

sudo -u postgres psql

Then create password

ALTER USER postgres PASSWORD 'demoPassword';

Edit conf

sudo vi /var/lib/pgsql/data/pg_hba.conf

Keep only

host all postgres password

systemctl stop postgresql

systemctl start postgresql

Add these settings to Postgres

Did you find this article valuable?

Support Ajeet Sinha by becoming a sponsor. Any amount is appreciated!