- Step 1: Update your apt package manager by running command: sudo apt update,
- Step 2: Now lets run the command sudo apt install nginx,
# sudo apt install nginx Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: fontconfig-config fonts-dejavu-core iproute2 libatm1 libbsd0 libcap2-bin libelf1 ... ... libxau6 libxcb1 libxdmcp6 libxpm4 libxslt1.1 libxtables12 nginx-common nginx-core ucf Suggested packages: iproute2-doc libgd-tools fcgiwrap nginx-doc The following NEW packages will be installed: fontconfig-config ... ... nginx nginx-common nginx-core ucf 0 upgraded, 34 newly installed, 0 to remove and 19 not upgraded. Need to get 4755 kB of archives. After this operation, 15.9 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libbsd0 arm64 0.10.0-1 [43.7 kB] Get:2 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libelf1 arm64 0.176-1.1build1 [44.2 kB] Get:3 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libmnl0 arm64 1.0.4-2 [11.3 kB] ... ... Get:32 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libnginx-mod-stream arm64 1.18.0-0ubuntu1.2 [63.2 kB] Get:33 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 nginx-core arm64 1.18.0-0ubuntu1.2 [399 kB] Get:34 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 nginx all 1.18.0-0ubuntu1.2 [3620 B] ... ... Fetched 4755 kB in 5s (951 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libbsd0:arm64. (Reading database ... 11528 files and directories currently installed.) Preparing to unpack .../00-libbsd0_0.10.0-1_arm64.deb ... Unpacking libbsd0:arm64 (0.10.0-1) ... ... Setting up libnginx-mod-http-image-filter (1.18.0-0ubuntu1.2) ... Setting up nginx-core (1.18.0-0ubuntu1.2) ... Not attempting to start NGINX, port 80 is already in use. Setting up nginx (1.18.0-0ubuntu1.2) ... Processing triggers for systemd (245.4-4ubuntu3.15) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... Progress: [ 99%] [#############################################################]
- Step 3: Now lets create a sample html page,
# cd /var/www # mkdir root # cd root # nano index.html
Add a sample html content in the index.html file to test,
<h1>Hello from Nginx Server on Ubuntu!&tl;/h1>
- Step 4: Now lets start the server: # sudo service nginx start
- Step 5: Now lets test that the server is up,
curl localhost/root/index.html <h1>Hello from Nginx Server on Ubuntu!</h1>
More Posts related to Ubuntu,
- Fix - sudo: systemctl: command not found
- How to know the version of Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- How to install Apache Maven on Ubuntu
- Steps to Kill a Running Process in Ubuntu Linux
- How to know current Ubuntu Linux version via terminal command
- How to stop/start/restart apache server using command [Ubuntu]
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
- Ubuntu: How to search for a package to install using apt in Terminal
- Fix: E: Command line option --installed is not understood in combination with the other options
- How to install Python on Ubuntu
- Ubuntu Linux: How to Login as root User
- Access Windows share folder in Ubuntu Device in Network
- Add a User as a Sudoer Using Ubuntu Linux Command Line Terminal
- Install Oh My Zsh on Ubuntu Docker complete steps
- Fix: Make makefile:31 Error 127 (GCC)
- [fix] openssl No such file or directory error C++
- How to install zsh shell on Ubuntu
- Install Golang (Go) on Ubuntu
- Ubuntu Linux: Unzip a zip file using Terminal
- Where are Environment Variables stored in Ubuntu
- apt-get list --installed packages in Ubuntu Linux
- Ubuntu: List all Installed Packages using apt
- Quick steps to install Nginx on Ubuntu Linux
- How to kill service running on a port on Ubuntu Linux
More Posts:
- Setting JAVA_HOME in macOS Big Sur - MacOS
- Fix Error: Unknown command: --cask [Homebrew] - MacOS
- Change File Created Date and Time using Mac Terminal Command - MacOS
- How to Copy a remote file to local using SFTP command? - FTP
- How to Reset Eclipse Theme to Classic - Eclipse
- Program 2: Print your name using print() function - 1000+ Python Programs - Python-Programs
- How to enable Do Not Disturb mode for Notification Center in Mac OS X 10.10 Yosemite - Mac-OS-X
- [Solution] Error: brew cask is no longer a brew command - MacOS