
Sanjay Sikdar
Launch an Ubuntu Instance and SSH Login to the Terminal
Reference: https://docs.docker.com/engine/install/ubuntu/
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg# Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update# Install the Docker packages.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginTest Docker:
sudo docker run hello-worldReference: https://listmonk.app/docs/installation/
mkdir listmonk && cd listmonk
# Download the compose file to the current directory.
curl -LO https://github.com/knadh/listmonk/raw/master/docker-compose.yml
# Run the services in the background.
docker compose up -dPermissions
sudo usermod -aG docker $USER
newgrp docker # Apply changes immediatelyOutput:
Listmonk is now up and running. Visit http://localhost:9000 in your browser.
Default Username listmonk and password listmonk .
server {
server_name *.sanjaysikdar.dev;
server_tokens off;
client_max_body_size 100M;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header 'Access-Control-Allow-Origin' 'https://sanjaysikdar.dev';
proxy_redirect off;
proxy_pass http://localhost:9000;
}
}#!/bin/bash
select opt in Restart CheckStatus UpdateListMonk Quit
do
case $opt in
Restart)
sudo nginx -t && sudo systemctl restart nginx
echo "Nginx has been restarted."
exit 0
;;
CheckStatus)
sudo systemctl status nginx
echo "Shell by Sanjay Sikdar"
exit 0
;;
UpdateListMonk)
cd /var/listmonk
docker-compose down
docker-compose pull && docker-compose run --rm app ./listmonk --upgrade
docker-compose up -d app db
exit 0
;;
Quit)
echo "Exited!"
exit 0
;;
*)
echo "invalid option"
;;
esac
doneAutostart
sudo nano /etc/systemd/system/listmonk.service[Unit]
Description=Listmonk Service
After=network.target docker.service
Requires=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker compose -f /home/ubuntu/listmonk/docker-compose.yml up
ExecStop=/usr/bin/docker compose -f /home/ubuntu/listmonk/docker-compose.yml down
WorkingDirectory=/home/ubuntu/listmonk
User=ubuntu
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable listmonk
sudo systemctl start listmonk
sudo systemctl status listmonk