Logo Cinquin Andy Signature

Install a PaaS with CapRover

Développeur Freelance - Logo

The sites and the associated resources.

Install a PaaS with CapRover

Posted on July 31, 2023 -  by Andy Cinquin

Basic VPS SetupUFW and Fail2Ban SecuritySSH Configuration on DebianCapRover on Contabo GuideDocker Containerization TutorialGitHub Secrets for CI/CDDocker Debugging and Apache LogsLinux User Creation ProcessSecure SSH Key AccessOVH Cloud Configuration StepsInstalling Node.js and npmEssential Linux CommandsDedicated Server ManagementTmux and vim InstallationWeb Application Deployment

Base install

ssh root@142.242.222.142
apt install sudo -y
apt install ufw -y
apt install tmux -y
apt install git -y
apt install fail2ban -y
apt install vim -y
useradd Andy -m -s /bin/bash
usermod-aG sudo Andy 
passwd Andy

// add an ssh key
cd /home/Andy/ 
mkdir .ssh 
vim /home/Andy/.ssh/authorized_keys 

(put the public ssh key inside)
cd /home/Andy
chown Andy:CinquinAndy .ssh/ -R
chmod 755 -R .ssh/
chmod 600 .ssh/authorized_keys

vim /etc/ssh/sshd_config 

// change:
// -> PubkeyAuthentication
// -> PasswordAuthentication
// -> PermitRootLogin
// -> AuthorizedKeysFile
Pasted image 20230728150606.png

Ufw

bashCopy codeufw allow 53  
ufw allow 443
ufw allow 22
ufw enable

Cap Rover

Prerequisites:
sudo ufw allow 80,443,3000,996,7946,4789,2377/tcp; 
sudo ufw allow 7946,4789,2377/udp;

OVH Config:
Pasted image 20230728150527.png
sudo apt install curl
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs 
npm install -g caprover
caprover serversetup

captain config

screenconf.png

Add an application

Containerize your app

docker build -t andycinquin/second-brain . 
docker run -d -p 8000:8000 andycinquin/second-brain 

~ push your app to DockerHub
docker login
docker tag second-brain andycinquin/second-brain
docker push andycinquin/second-brain

Create secrets on GitHub

APP_IMAGE docker.io/andycinquin/songflow-prod:latest APP_NAME songflow APP_TOKEN $token from caprover APP_URL captain.beta.andy-cinquin.fr
DOCKER_PASSWORD docker.io password DOCKER_USERNAME docker.io username

Debug:

docker ps
docker exec -it {docker number} bash
tail -f /var/log/apache2/access.log -n 100



Thank you for your visit, feel free to contact me for any information, quote or collaboration proposal. I will be happy to answer you as soon as possible.
Did you like this article? Feel free to share it!

DEVELOP YOUR PROJECTS TOGETHER

An idea, a project? I'm here to answer your questions and help you.
I'd be delighted to discuss your project with you!