connect to the terminal using your creadentials and install dependencies
- example
ssh root@192.168.5.10
- update & install Hestiacp
sudo apt update && sudo apt upgrade
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh
sudo groupdel admin
bash hst-install.sh
** If hestiacp installed successfully it will provide a credential to login in the Cpanel
- example:
Admin URL: https://vmi2311142.contaboserver.net:8083
Backup URL: https://82.192.71.175:8083
Username: admin
Password: 5vFZn4jEx8Qowh7w
visit admin or backup url and login with username & password
- create new user and create web for your application
- example:
bdcommerce.app
- example:
- add ssl and alias from edit domain
- example (alias):
www.bdcommerce.app
- example (alias):
open new terminal & connect: sftp remote-user@remote-server-ip (then your password)
- if connected you can upload any file using: put
- example:
sftp root@82.197.71.175 (password)
put your-file-path
- close connection
exit
connect to the terminal again: ssh remote-user@remote-server-ip (then your password) and install node, npm and pm2
nvm install --lts
npm i pm2 -g
- now unzip the files
- example:
unzip app.zip
- move folders to the domain path
- example:
mv file-path/* new-path
- Now go to the file path
- example:
cd /home/file-path
- install all dependencies
- example:
npm i
- run the application using pm2
- example:
pm2 start npm --name api -- start
- check the server's output
- example:
curl localhost:5000
- config domain first go to the nginx config file by Hestia for your app
- example (replace with your path-name):
nano /home/bdcommerce/conf/web/bdcommerce.app/nginx.conf
- replace proxy_pass with your running port
- example:
proxy_pass http://localhost:5000;
** save the file 'ctrl+o' then 'enter' then 'ctrl+x'
- config ssl domain
- example:
nano /home/bdcommerce/conf/web/bdcommerce.app/nginx.ssl.conf
- replace proxy_pass with your running port
- example:
proxy_pass http://localhost:5000;
** save the file 'ctrl+o' then 'enter' then 'ctrl+x'
- Restart the nginx server
sudo systemctl restart nginx
- check domain if proxy is working or not
- example: curl bdcommerce.app
Note: If everything is working then make sure HestiaCP will not change the Nginx config:
chattr +i /home/bdcommerce/conf/web/bdcommerce.app/nginx.conf
chattr +i /home/bdcommerce/conf/web/bdcommerce.app/nginx.ssl.conf
Check attribute if ---i--- exit that means it's immutable
lsattr /home/bdcommerce/conf/web/bdcommerce.app/
Thanks 💚
N I Rimon
Top comments (0)