How to install phpmyadmin on Ubuntu 16.04

Follow following steps to install phpmyadmin

sudo apt-get update

sudo apt-get install phpmyadmin

Move folder to /var/www

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

create separate nginx file for this

server {
listen 80;
listen [::]:80;

root /var/www/phpmyadmin;
index index.html index.htm index.nginx-debian.html;


location / {
#try_files $uri $uri/ =404;
# original content
try_files $uri /index.php$is_args$args;
#try_files $uri $uri/ /index.php$is_args$args;

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
include snippets/fastcgi-php.conf;

# With php7.0-cgi alone:
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#location ~ /\.ht {
# deny all;


Check nginx syntax error and restart nginx

sudo nginx -t

sudo systemctl restart nginx

Add an entry to your host file located at sudo nano /etc/hosts



and now when you access, it will open phpmyadmin


Leave a Reply

Your email address will not be published. Required fields are marked *