Step By Step Install Nginx And Phpmyadmin On Ubuntu
Introduction
Setting up a web server on Ubuntu is easy and straightforward. Nginx is a popular web server for Ubuntu, and it can be used for hosting websites, running web applications, and managing databases. Additionally, phpMyAdmin is a widely used web-based database management system. Nginx and phpMyAdmin are both available in Ubuntu’s repositories, which makes installation and set-up relatively easy. In this article, we’ll install Nginx and phpMyAdmin on Ubuntu 18.04.
Prerequisites
Before you begin, you will need the following:
- A server running Ubuntu 18.04.
- A user with sudo privileges.
Step 1 – Installing Nginx
Nginx is available in Ubuntu’s repositories, so we can install it using apt. To do this, connect to your server via SSH and update your package list with the command:
sudo apt update
Now, you can install Nginx with:
sudo apt install nginx
Once installed, you should see the output below:
Output
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
...
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
...
Nginx is being configured
Setting up nginx (1.14.0-0ubuntu1.2) ...
When the installation completes, you can check if the service is running with the command:
sudo systemctl status nginx
You should see something similar to the following output, which indicates that Nginx is running:
Output
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-04-10 17:10:09 UTC; 8min ago
Docs: man:nginx(8)
Main PID: 3165 (nginx)
Tasks: 2 (limit: 1153)
CGroup: /system.slice/nginx.service
├─3165 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─3166 nginx: worker process
Apr 10 17:10:08 ubuntu1804 systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 10 17:10:09 ubuntu1804 systemd[1]: Started A high performance web server and a reverse proxy server.
You can also verify that Nginx is running by accessing the IP address of your server in a web browser. You should see a welcome page, which looks like this:
Step 2 – Installing phpMyAdmin
Now we can install phpMyAdmin. First, we need to add the repository:
sudo add-apt-repository ppa:ondrej/php
When prompted, press ENTER to continue. Now, we can update our packages and install phpMyAdmin with the command:
sudo apt update
sudo apt install phpmyadmin
You will be asked a few questions during the installation. For the webserver selection, select apache2.
You’ll also be asked to configure a database for phpMyAdmin to use. Select yes, and then choose a password for the phpMyAdmin user. Make sure to remember this password. When you’ve finished, press OK.
Once it’s installed, you can access phpMyAdmin in a web browser. You’ll be asked to sign in with the user and password you just created. When you log in, you’ll see the phpMyAdmin dashboard.
Step 3 – Configuring Nginx
Now that Nginx and phpMyAdmin are both installed, we can configure Nginx to serve phpMyAdmin. First, we need to create a configuration file in the sites-available directory.
sudo nano /etc/nginx/sites-available/phpmyadmin
Add the following lines to the file:
server {
listen 80;
server_name the_domain_or_IP;
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}
Save the file, exit the text editor, and activate the configuration with the command:
sudo ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/
You can verify the configuration syntax with:
sudo nginx -t
If it’s valid, you should see the output below:
Output
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Finally, restart Nginx for the changes to take effect:
sudo systemctl restart nginx
Now, you can access phpMyAdmin in a web browser. You will be asked to log in with the user and password you created during installation.
Conclusion
We’ve successfully installed and configured Nginx and phpMyAdmin on Ubuntu 18.04. You should now have a basic web server that you can use to serve websites and web applications. Good job!
FAQs
Q: What is Nginx?
A: Nginx is a popular high performance web server used by websites and applications.
Q: What is phpMyAdmin?
A: phpMyAdmin is a web-based database management system used for managing MySQL and MariaDB databases.
Q: What is the default port for Nginx?
A: The default port for Nginx is port 80.
Q: How can I access phpMyAdmin?
A: You can access phpMyAdmin in a web browser by navigating to http://your-server-IP/phpmyadmin.
Thank you for reading this article. For more information please visit our other articles.
Related Posts:
- Install Nginx Phpmyadmin Centos 7 Install Nginx Phpmyadmin Centos 7 What is Nginx? Nginx is a web server that is used in Linux-based operating systems such as Centos 7. It is designed to handle high-traffic…
- Ubuntu 16.04 Nginx Ipv6 Ubuntu 16.04 Nginx Ipv6 What is Ubuntu 16.04? Ubuntu 16.04 is a version of the Ubuntu Linux operating system for computers and servers. Ubuntu has been around since 2004, and…
- Nginx Install Ssl Certificate Ubuntu Nginx Install SSL Certificate Ubuntu What is Nginx? Nginx is a free, open-source web server that is used for powering websites. It is popular for its speed, scalability, and stability,…
- Install Php5 Nginx Ubuntu 18.04 Install PHP5 Nginx Ubuntu 18.04 Understanding The Basics of Nginx and PHP Before we learn how to install Nginx and PHP on Ubuntu 18.04, it’s important to understand the basic…
- Cara Install Phpmyadmin Di Nginx Ubuntu Cara Install Phpmyadmin Di Nginx Ubuntu Pengertian PhpMyAdmin PhpMyAdmin adalah antarmuka web-berbasis yang memungkinkan Anda untuk mengelola basis data MySQL dan istilah yang lebih umum dalam pengelolaan basis data SQL.…
- How To Deactive Nginx Ubuntu How To Deactivate Nginx Ubuntu Introduction Nginx is a web server that’s popular in the Linux world because of its simple configuration, scalability, and performance. The Apache httpd web server…
- Install Mysql Pada Nginx Pada Ubuntu Install Mysql Pada Nginx Pada Ubuntu Overview of Nginx and Its Benefits Nginx is a web server, reverse proxy server, and mail proxy server application that is open-source and available…
- Install Nginx And Php On Ubuntu 18.04 Install Nginx And Php On Ubuntu 18.04 Introduction In this article, we will guide you on how to install Nginx and php on Ubuntu 18.04. Nginx is a popular web…
- Install Pdo_Mysql Ubuntu Nginx Install Pdo_Mysql Ubuntu Nginx What is Pdo_Mysql? PDO_Mysql is a driver for the PHP Data Objects (PDO) extension that provides a database abstraction layer for working with MySQL databases.PDO_Mysql provides…
- Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed What Is Nginx? Nginx is a web server software, similar to Apache, used for serving webpages. It is open source, and is often…
- Upload Max Size Nginx Phpmyadmin Upload Max Size Nginx Phpmyadmin What is Nginx? Nginx is an open source web server and reverse proxy created for high performance and scalability. It is used to serve web…
- How To Login Phpmyadmin In Nginx Server Ubuntu How To Login Phpmyadmin In Nginx Server Ubuntu What is Nginx & phpMyAdmin Nginx is a web server software that is commonly used on Linux-based systems, though it works on…
- How Use Nginx Mysql Ubuntu How to Use Nginx, MySQL and Ubuntu What is Nginx? Nginx is an open source web server and reverse proxy software written by Igor Sysoev. It is a popular choice…
- How To Ubuntu 16.04 Multiple Php Nginx How to Ubuntu 16.04 Multiple PHP Nginx Ubuntu 16.04 is a robust operating system that is commonly used for web application development. This operating system uses Nginx as the web…
- Install Nginx Latest Ubuntu 16.04 Install Nginx Latest Ubuntu 16.04 What is Nginx? Nginx is a web server. It is also an open source and free software. It was first developed by Igor Sysoev in…
- Nginx Ubuntu Access Virtual Host From Another… Nginx Ubuntu Access Virtual Host From Another Machine Over LAN Are you trying to access a virtual host set up using Nginx on Ubuntu from another machine over a LAN?…
- Stop Nginx Ubuntu 16.04 Stop Nginx Ubuntu 16.04 What is Nginx? Nginx is a web server and reverse proxy software. It is open source and widely used on the web. It is used to…
- Cara Install Nginx Ubuntu 14.04 Cara Install Nginx Ubuntu 14.04 Step 1: Update the Software Packages The first step in installing Nginx is to update the software packages in Ubuntu 14.04. This can be done…
- Tutorial Install Nginx Di Ubuntu Vps Tutorial Install Nginx Di Ubuntu Vps Step 1: Install Nginx The first step to install nginx in your Ubuntu VPS is to install the nginx package. To do this, use…
- Setting Phpmyadmin Di Nginx Debian 9 Setting Phpmyadmin Di Nginx Debian 9 Introduction Nginx is a popular web server created for Unix-like operating systems like Debian. It is used for many web-related activities such as serving…
- Bash Install Nginx On Ubuntu How To Install Nginx On Ubuntu What is Nginx? Nginx is a web server that is gaining popularity in the world of web hosting. Nginx is an open source web…
- Install Nginx And Php On Ubuntu Install Nginx And Php On Ubuntu A Comprehensive Tutorial to Install Nginx And Php On Ubuntu Nginx and PHP are two of the most popular web server and scripting language…
- Install Postgis Ubuntu 18.04 Nginx Install Postgis Ubuntu 18.04 Nginx What is Postgis? Postgis is a Postgres-based open source geographic information system (GIS) that enables users to store, query, and analyze spatial data stored in…
- Remove Nginx Full Complete On Ubuntu 18 Remove Nginx Full Complete On Ubuntu 18 Uninstallating Nginx From Ubuntu Ubuntu is one of the most popular Linux-based operating systems, and it has a wide variety of programs available…
- Virtualhost Nginx Ubuntu 16.04 Virtualhost Nginx Ubuntu 16.04 Introduction to Virtualhost Virtualhost is a software configuration option in web servers including Apache, Nginx, and more that allows a web server to host multiple web…
- Nginx Ssl Configuration Ubuntu 18.04 Nginx Ssl Configuration Ubuntu 18.04 What is Nginx? Nginx is an open source web server and reverse proxy software. It is used to manage web traffic on the internet, like…
- Install Odoo 11 Nginx Ubuntu 16 Install Odoo 11 Nginx Ubuntu 16 What is Odoo 11 Nginx? Odoo 11 Nginx is an open source software package designed to facilitate secure and reliable web development. It is…
- Add Root Password Mysql Nginx Ubuntu 16.04 Add Root Password Mysql Nginx Ubuntu 16.04 What is a root password? In the context of computer security, a root password is a user account that is given access to…
- Nginx Wordpress Ubuntu 18.04 Nginx Wordpress Ubuntu 18.04 Introduction to Nginx Nginx is a web server software for hosting websites and applications. It is open-source and highly configurable, making it a popular choice for…
- Install Phpmyadmin On Nginx Ubuntu Install Phpmyadmin On Nginx Ubuntu What Is Phpmyadmin? Phpmyadmin is a free, open source web application written in PHP specifically designed to help manage MySQL databases. It is a powerful…