{"id":2661,"date":"2023-08-30T22:47:37","date_gmt":"2022-08-21T09:26:04","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-phpmyadmin-with-nginx-and-let-039-s-encrypt-ssl-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-phpmyadmin-with-nginx-and-let-039-s-encrypt-ssl-on-ubuntu-24-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 PhpMyAdmin with Nginx and Let&#039;s Encrypt SSL on Ubuntu 24.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p>PhpMyAdmin is a popular web-based tool used to manage MySQL and MariaDB databases. When combined with Nginx and secured using Let&#8217;s Encrypt SSL, it provides a powerful, secure way to manage your databases. In this guide, we&#8217;ll walk through the process of installing PhpMyAdmin on Ubuntu 24.04 with Nginx and securing it using a free Let&#8217;s Encrypt SSL certificate. This setup is ideal for both local servers and <strong>VPS servers<\/strong>.<\/p>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing any packages, it&#8217;s important to ensure your Ubuntu 24.04 server is up to date. Run the following command to update the package list and upgrade any outdated packages:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Nginx and PHP<\/h2>\n<p>Next, install Nginx and PHP, which are required for PhpMyAdmin to function:<\/p>\n<pre><code>sudo apt install nginx php-fpm php-mysql -y<\/code><\/pre>\n<p>Once the installation is complete, start and enable Nginx:<\/p>\n<pre><code>sudo systemctl start nginx\r\nsudo systemctl enable nginx<\/code><\/pre>\n<h2>Step 3: Install PhpMyAdmin<\/h2>\n<p>PhpMyAdmin is not included in the default Ubuntu repositories, so you&#8217;ll need to download it manually. Begin by navigating to your web directory:<\/p>\n<pre><code>cd \/var\/www\/html<\/code><\/pre>\n<p>Download the latest version of PhpMyAdmin using the following command:<\/p>\n<pre><code>wget https:\/\/www.phpmyadmin.net\/downloads\/phpMyAdmin-latest-all-languages.tar.gz<\/code><\/pre>\n<p>Extract the downloaded file:<\/p>\n<pre><code>sudo tar xvf phpMyAdmin-latest-all-languages.tar.gz<\/code><\/pre>\n<p>Rename the extracted directory to &#8220;phpmyadmin&#8221; for simplicity:<\/p>\n<pre><code>sudo mv phpMyAdmin-*-all-languages phpmyadmin<\/code><\/pre>\n<p>Change the ownership of the PhpMyAdmin directory to the Nginx user:<\/p>\n<pre><code>sudo chown -R www-data:www-data \/var\/www\/html\/phpmyadmin<\/code><\/pre>\n<h2>Step 4: Configure Nginx for PhpMyAdmin<\/h2>\n<p>Create a new Nginx server block for PhpMyAdmin:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/phpmyadmin.conf<\/code><\/pre>\n<p>Add the following configuration to the file:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name your_domain;\r\n\r\n    root \/var\/www\/html\/phpmyadmin;\r\n    index index.php index.html index.htm;\r\n\r\n    location \/ {\r\n        try_files $uri $uri\/ =404;\r\n    }\r\n\r\n    location ~ \\.php$ {\r\n        include snippets\/fastcgi-php.conf;\r\n        fastcgi_pass unix:\/var\/run\/php\/php-fpm.sock;\r\n    }\r\n\r\n    location ~ \/\\.ht {\r\n        deny all;\r\n    }\r\n}\r\n        <\/code><\/pre>\n<p>Save and exit the file. Enable the configuration by creating a symbolic link:<\/p>\n<pre><code>sudo ln -s \/etc\/nginx\/sites-available\/phpmyadmin.conf \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Test the Nginx configuration for errors:<\/p>\n<pre><code>sudo nginx -t<\/code><\/pre>\n<p>If the configuration is valid, restart Nginx to apply the changes:<\/p>\n<pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<h2>Step 5: Secure PhpMyAdmin with Let&#8217;s Encrypt SSL<\/h2>\n<p>Next, secure PhpMyAdmin by installing a free SSL certificate from Let&#8217;s Encrypt. Begin by installing Certbot, the tool used to request and manage SSL certificates:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-nginx -y<\/code><\/pre>\n<p>Request an SSL certificate for your domain using Certbot:<\/p>\n<pre><code>sudo certbot --nginx -d your_domain<\/code><\/pre>\n<p>Follow the on-screen instructions to complete the process. Certbot will automatically configure Nginx to use the SSL certificate and redirect HTTP traffic to HTTPS.<\/p>\n<h2>Step 6: Verify SSL and PhpMyAdmin Setup<\/h2>\n<p>Once the SSL certificate is installed, you can verify the SSL setup by visiting your domain in a web browser using HTTPS:<\/p>\n<pre><code>https:\/\/your_domain<\/code><\/pre>\n<p>You should see the PhpMyAdmin login page. Log in with your MySQL or MariaDB credentials to start managing your databases.<\/p>\n<h2>Step 7: Enable Automatic SSL Renewal<\/h2>\n<p>Let&#8217;s Encrypt SSL certificates expire after 90 days. To ensure your certificate is automatically renewed, add a cron job to run the renewal process regularly:<\/p>\n<pre><code>sudo crontab -e<\/code><\/pre>\n<p>Add the following line to renew the certificate automatically:<\/p>\n<pre><code>0 0 * * * \/usr\/bin\/certbot renew --quiet<\/code><\/pre>\n<h2>Using PhpMyAdmin on a VPS Server<\/h2>\n<p>If you&#8217;re running a <strong>VPS server<\/strong>, installing PhpMyAdmin with Nginx and Let&#8217;s Encrypt SSL ensures that you can securely manage your MySQL databases. By combining the flexibility of Nginx with the security of free SSL from Let&#8217;s Encrypt, your <strong>VPS<\/strong> environment remains protected while providing easy access to your database administration.<\/p>\n<h2>Looking for a Reliable VPS Solution?<\/h2>\n<p>If you&#8217;re looking for a secure and reliable <strong>VPS server<\/strong> to run PhpMyAdmin and manage your databases, consider using . With <strong>Windows VPS<\/strong>, you get scalable VPS hosting that ensures your applications run smoothly with full security and performance optimization.<\/p>\n<footer>\n<p>For more VPS server solutions and guides, visit <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">netcloud24.com<\/a>.<\/p>\n<\/footer>\n<\/section>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 PhpMyAdmin is a popular web-based tool used to manage MySQL and MariaDB databases. When combined with Nginx and secured using Let&#8217;s Encrypt SSL, it provides a\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2661"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2661\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}