NOTE: This guide does not cover the actual installation of Ubuntu. Use at your own risk. Basic configuration is applied here - DYOR.
Basic configuration commands to have your Ubuntu Server up and running on production.
- Update And Upgrade
- Enable Firewall
- Install Further Tools
- Install Further Applications
- Update The Operating System
sudo reboot
Restart and wait for some time and the Linux server will reboot itselfsudo apt-get update
sudo apt-get upgrade
And sometimes:
sudo apt-get dist-upgrade
If there is a new release upgrade:
do-release-upgrade
UFW (Uncomplicated Firewall) is installed by default on Ubuntu. If it has been uninstalled for some reason, you can install it with sudo apt install ufw
.
sudo vi /etc/default/ufw
. CheckIPV6=yes
sudo ufw reset
sudo ufw status verbose
. Should show inactivesudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
orsudo ufw allow 22
. Allowing Secure Shell (SSH)sudo ufw enable
sudo ufw status verbose
. Should show active
sudo ufw allow http
orsudo ufw allow 80
. HTTP on port 80, which is what unencrypted web servers use.sudo ufw allow https
orsudo ufw allow 443
. HTTPS on port 443, which is what encrypted web servers use
Reference: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04
sudo timedatectl set-timezone UTC
. Set Timezone UTC/GMT+0sudo apt-get install net-tools
to install tools for commands likeifconfig -a
(network interface) andnetstat
sudo apt install openssh-server
. You should already have this installed so this command won't do anything
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
. Download Node.jssudo apt-get install -y nodejs
. Install Node.jssudo npm install -g @angular/cli
. Install Angular CLI
Reference: https://github.com/nodesource/distributions/blob/master/README.md
sudo apt install -y build-essential libaio1
Install the required packages: build-essential & libaio1sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Add the repository that provides PostgreSQL 14 on Ubuntuwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Import the GPG signing key for the repositorysudo apt -y update
Update your APT package listsudo apt install -y postgresql-14 postgresql-server-dev-14
Installing Postgres 14
sudo mkdir /opt/oracle
Create a directory for the installation and go to the directorysudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-basic-linux.x64-21.7.0.0.0dbru.zip
Download Oracle Client filessudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip
Download Oracle SQLPLUS filessudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip
Download Oracle SDK file. (Optional)sudo apt-get install unzip
Installing unzipsudo unzip instantclient-basic-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracle
Unziping clientsudo unzip instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracle/
Unziping sqlplussudo unzip instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracle
Unzipping Oracle SDKnano ~/.profile
Configure SQLPlusexport PATH="$PATH:/opt/oracle/instantclient_21_7"
Copy and paste this line to the end of the fileexport LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_21_7"
And then copy and paste this line too to the end of the filesource ~/.profile
Executesudo sh -c "echo /opt/oracle/instantclient_21_7 > /etc/ld.so.conf.d/oracle-instantclient.conf"
Add Oracle shared libraries to the system's shared library cachesudo ldconfig
Indexing the library cacheexport ORACLE_HOME=/opt/oracle/instantclient_21_7
Set ORACLE_HOME as /opt/oracle/instantclient_21_7sqlplus [USER]/[PASSWORD]@[IP:PORT]/[SERVICE_NAME]
Test the connection to Oracle
sudo apt update
Access the package servers and check to see if any of your installed packages have new versions available.sudo apt dist-upgrade
Install the updates. This will show you the list of packages that are about to be updated, and if the total installation size is large enough, it will show you the size and prompt you to confirm that you accept.y
Ensure that you have enough space available to do this, then press y and Enter to begin the update process.sudo apt autoremove
Clean up any old versions of packages that were just replacedcat /var/run/reboot-required
Check if your system needs to be rebooted. If the command printsNo such file or directory
, then reboot is not required and you can skip the reboot. However if the command prints*** System restart required ***
, then you should restart your machine to finish applying the updates when you are able:sudo reboot
Reference: https://manjaro.site/how-to-install-oracle-instant-client-on-ubuntu-20-04/