2.9 KiB
2.9 KiB
Server and Application Installation
Services to install
Mongo DB Community 8+
sudo apt-get install gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc |
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org sudo systemctl start mongod
sudo systemctl status mongod sudo systemctl enable mongod
NodeJS
curl -fsSL https://fnm.vercel.app/install | bash
source ~/.bashrc
fnm use --install-if-missing 22
node -v # should printv22.11.0
npm -v # should print10.9.0
PM2
npm install pm2 -g
pm2 startup
- NGINX. Important config - set redirect from http to https. Virtual host config example - nginx.
your_dl_name.conf - PM2. Install and enable the process manager for nodejs (after NodeJS and NPM are installed). Config and run using the nonroot user.
- SPHINX. Install in /opt/sphinx. Create a service using config in sphinx.service. Copy to sphinx bin/ folder and configure FTS indexes in sphinx.conf template. Make sure all paths are available. /opt/sphinx should be owned by the nonroot user.
Tools to install
- NodeJS and NPM (currently Node v16, NPM v8)
- Mongo DB tools
- Let's Encrypt CertBot, for certificates issuing and renewal. The certificate is installed using the following command:
certbot certonly -d your.server.name. Use--nginxor--apachein order to have automatic renewal - ffmpeg - for converting video and audio content
- ghostscript - for creating thumbnails for PDF files
- OpenSSH Server - to be able to access the server remotely
- UFW - Firewall, configure to allow access only on 443, 80, and 22 (if possible, only for specific hosts)
- rsync - for backup
- fail2ban - to protect from SSH attacks
- postfix - in order to get CRON jobs notifications
- mailutils - CRON jobs mail notifications
- In order to enable web server monitoring you can install and run:
- Linux Dash using this instruction. You can run it using
pm2 start ecosystem.config.js(on https://your.server.name/host-monitor/) OR
- Netdata -
wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --stable-channel
- Linux Dash using this instruction. You can run it using