Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Secure phpMyAdmin With an SSL Certificate on Ubuntu

Protect phpMyAdmin credentials and sessions by configuring HTTPS in Apache, issuing a hostname-matched Let’s Encrypt certificate with Certbot, testing renewal, and treating database-link TLS as a separate setting.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Secure phpMyAdmin at the Apache layer, not inside phpMyAdmin itself. Point the exact hostname users will enter to your Ubuntu server, obtain a certificate for that name (normally with Certbot and Let’s Encrypt), configure the HTTPS VirtualHost that serves the /phpmyadmin alias, and redirect ordinary HTTP traffic to HTTPS. Then test renewal and, if the database is remote or crosses an untrusted network, configure MySQL/MariaDB TLS separately.

What HTTPS protects—and what it does not

When a browser opens https://dbadmin.example.com/phpmyadmin/, TLS encrypts the connection between that browser and Apache. This protects phpMyAdmin passwords, session cookies, SQL statements, and result pages while they travel across the client-to-web-server path. The certificate also lets the browser verify that it is talking to the hostname named in the certificate.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

phpMyAdmin is usually an Apache application reached through an alias such as /phpmyadmin. The HTTPS certificate, protocol selection, redirects, and VirtualHost matching are therefore Apache tasks. Installing a certificate does not automatically encrypt the next hop from Apache/phpMyAdmin to MySQL or MariaDB. Database-link encryption and server identity verification must be configured independently in phpMyAdmin and on the database server.

Choose the hostname and certificate method first

Use one precise public hostname

Choose the fully qualified domain name administrators will type, for example dbadmin.example.com. Create an A record, and an AAAA record if you intend to serve IPv6, pointing that name to the Ubuntu server. Apache’s ServerName must use the same name. Add a ServerAlias only for additional names that really resolve to this server and will be included in the certificate’s Subject Alternative Names (SANs).

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

A certificate for example.com does not automatically cover the unrelated subdomain dbadmin.example.com. The browser URL, DNS answer, Apache host name, and certificate SAN must agree.

Public names: Let’s Encrypt with HTTP-01

For a public DNS name, Let’s Encrypt issues certificates through the ACME protocol. The common HTTP-01 challenge requires the name to resolve to this server and requires inbound TCP port 80 during issuance and renewal. Let’s Encrypt certificates are valid for 90 days, so renewal is routine operational work rather than a one-time installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When DNS-01 or an internal CA is a better fit

Use DNS-01 when port 80 cannot be exposed or when you need a wildcard certificate. The challenge is completed with a DNS record instead of an HTTP request. A private-only hostname that cannot be resolved publicly is not a suitable target for a normal HTTP-01 validation. For an internal administrative deployment, use DNS-01 with a DNS provider that can validate the name, or use an internal certificate authority and install that CA’s trust on every administrative client.

Situation Suitable approach Important condition
Public FQDN and port 80 reachable Certbot Apache plugin with HTTP-01 DNS must point to this server; keep port 80 reachable for renewal.
Port 80 cannot be exposed DNS-01 validation You need control of the authoritative DNS zone.
Wildcard needed DNS-01 validation HTTP-01 cannot issue wildcard certificates.
Private, non-public hostname DNS-01 or an internal CA Administrative clients must trust the issuing CA.

Check Ubuntu, DNS, and firewall prerequisites

  • Use a registered domain name and decide the exact FQDN before editing Apache.
  • Confirm the A/AAAA record resolves to the intended Ubuntu server, not an old address or another proxy.
  • Permit inbound TCP 80 for HTTP-01 validation and TCP 443 for normal HTTPS access. Check cloud security groups, host firewalls, NAT, and any reverse proxy.
  • Make sure Apache already has a VirtualHost for the chosen name. Certbot’s Apache integration uses that host to place the TLS directives.
  • Keep a privileged shell available, and never publish or paste the private key.

From an external network, verify that the hostname resolves correctly and that an HTTP request reaches this server. A DNS answer that is correct inside your office but different on the public Internet will still fail a public ACME challenge.

Enable Apache SSL support

On Ubuntu, enable Apache’s SSL module:

sudo a2enmod ssl

Ubuntu supplies /etc/apache2/sites-available/default-ssl.conf as a starting point. The package-generated certificate in that example is for testing only. Replace its certificate and key directives with files issued for your real hostname. If your certificate files are outside /etc/ssl/certs and /etc/ssl/private, set the full paths explicitly.

A minimal HTTPS VirtualHost has the following shape; adapt the paths, document root, and phpMyAdmin alias to your installation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName dbadmin.example.com
    ServerAlias www.dbadmin.example.com

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/dbadmin.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/dbadmin.example.com/privkey.pem

    # Keep the alias supplied by your phpMyAdmin package/configuration.
    Alias /phpmyadmin /usr/share/phpmyadmin
    <Directory /usr/share/phpmyadmin>
        Require all granted
    </Directory>
</VirtualHost>
</IfModule>

Do not copy the example’s Alias or access rules blindly if your distribution package has already created a dedicated phpMyAdmin configuration. The essential requirement is that the HTTPS VirtualHost serving the chosen hostname also serves the phpMyAdmin alias.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Obtain and install a trusted certificate with Certbot

Install Certbot

Ubuntu documents the snap installation method:

sudo snap install --classic certbot

Use the same installation source consistently for later commands and renewal maintenance. If your Ubuntu release or organizational policy uses a packaged Certbot instead, follow that package’s documented service and file locations.

Let Certbot edit Apache

With the named VirtualHost enabled and DNS/port 80 working, request and install a certificate:

sudo certbot --apache -d dbadmin.example.com

Add another -d only when that additional name resolves correctly and should be covered by the same certificate, for example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo certbot --apache -d dbadmin.example.com -d dbadmin.example.net

Certbot’s Apache plugin finds the matching VirtualHost, adds the TLS directives, and reloads Apache. Issued material is stored under /etc/letsencrypt/live/<domain>/. For Apache, the usual pair is:

  • fullchain.pem — the server certificate followed by the issuing chain, which Apache presents to clients.
  • privkey.pem — the private key; keep it readable only by the accounts that must use it.

Do not email, commit, or otherwise expose privkey.pem. A certificate can be replaced; a leaked private key requires revocation and a new issuance.

If Certbot cannot change Apache

You can obtain the certificate without modifying the web server:

sudo certbot certonly --webroot -w /var/www/html -d dbadmin.example.com

The webroot must be the directory actually served for the HTTP VirtualHost, and the ACME challenge path must remain reachable. Then set SSLCertificateFile to the resulting fullchain.pem and SSLCertificateKeyFile to privkey.pem in your HTTPS VirtualHost.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Standalone mode is another option when no webroot can answer the challenge:

sudo certbot certonly --standalone -d dbadmin.example.com

Standalone mode temporarily binds port 80. Stop the service currently using that port before running it, then start the service again after issuance. This interruption is one reason the Apache plugin or webroot method is generally preferable on a live phpMyAdmin server.

Enable the HTTPS site and validate Apache

If you maintain the VirtualHost manually, enable the site (use your actual site filename):

sudo a2ensite default-ssl

For a custom file, use its name instead, such as sudo a2ensite dbadmin-ssl.conf. Before applying edits, ask Apache to parse every enabled configuration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apache2ctl configtest

Proceed only when the result is Syntax OK. Reload rather than restart for ordinary certificate or VirtualHost changes:

sudo systemctl reload apache2

A reload applies the new configuration while avoiding an unnecessary interruption. If the configuration test reports an error, fix the reported file and line first; do not reload a known-invalid configuration.

Redirect HTTP without breaking certificate validation

Keep an HTTP VirtualHost on port 80 so ACME HTTP-01 requests can reach the server. After issuance, redirect normal requests to HTTPS:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
<VirtualHost *:80>
    ServerName dbadmin.example.com
    Redirect permanent / https://dbadmin.example.com/
</VirtualHost>

Ensure your redirect strategy does not block the ACME challenge path when HTTP-01 is used. Certbot-managed configurations normally account for this, but inspect custom rewrite rules. Test both http://dbadmin.example.com/phpmyadmin/ and https://dbadmin.example.com/phpmyadmin/; the first should reach the HTTPS URL, and the second should load phpMyAdmin without a certificate warning.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm that phpMyAdmin is served by the intended HTTPS VirtualHost

Open the exact HTTPS hostname, including the trailing slash:

https://dbadmin.example.com/phpmyadmin/

In the browser’s certificate details, check the subject/SAN contains the hostname, the chain is trusted, and the expiration date is in the future. Log in and verify that the session remains on HTTPS after navigation. A page that loads over HTTPS but submits a login form to HTTP, or references HTTP-only assets, indicates an application or VirtualHost configuration problem that still needs correction.

Diagnose a wrong certificate

Apache selects a VirtualHost by the requested IP, port, and hostname. If the request does not match the intended ServerName or ServerAlias, Apache can serve another enabled site’s certificate; an unmatched request falls through to the default VirtualHost. Check the enabled sites and the *:443 host order, then make sure the requested name appears exactly in the intended VirtualHost and certificate SANs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand the separate phpMyAdmin-to-MySQL TLS decision

Browser HTTPS does not change the connection phpMyAdmin makes to MySQL or MariaDB. If the database is on the same host and the connection uses a protected local socket, the threat model differs from a database connection crossing a network. For a remote server or an untrusted segment, configure database TLS deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

phpMyAdmin exposes these settings through environment variables or the corresponding server configuration entries:

Purpose phpMyAdmin setting What to decide
Enable encrypted database transport PMA_SSL=1 or $cfg['Servers'][$i]['ssl'] Whether the MySQL/MariaDB client connection should use TLS.
Verify the database server certificate PMA_SSL_VERIFY=1 or $cfg['Servers'][$i]['ssl_verify'] Whether the server identity must chain to a trusted CA and match expectations.
Trust the issuing authority CA option Which CA certificate file phpMyAdmin uses to validate the database server.
Client authentication Client certificate and client key options Whether the database requires mutual TLS and where those credentials are stored.

Disabling server-certificate verification weakens identity checking and should be used only with a clear, controlled reason. Choose a CA, client-certificate policy, file permissions, and database-side TLS configuration that match the server’s certificate and authentication requirements. Test this hop separately from browser HTTPS; both can succeed or fail independently.

Make renewal reliable

Certbot certificates expire after 90 days. Ubuntu documents a systemd timer that attempts renewal twice a day. Check the process without changing the live certificate:

sudo certbot renew --dry-run

A successful dry run confirms that the renewal authorization and installer path can work. It does not prove that every external firewall, DNS change, proxy, or future Apache edit will remain correct, so monitor the timer and certificate expiry as part of server operations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When Certbot manages the Apache installation, its integration reloads Apache after a successful renewal. If you copied certificate paths into another service or maintain the VirtualHost yourself, add a suitable deploy hook to reload that service after renewal. After a real renewal, verify that the active HTTPS VirtualHost points at the renewed files; otherwise clients can continue seeing an old certificate until Apache is reloaded.

Troubleshoot common failures

“Connection refused” or an HTTP-01 timeout

  • Confirm the public A/AAAA record points to this server.
  • Allow TCP 80 through the Ubuntu firewall, cloud security group, NAT device, and upstream proxy.
  • Check that another service is not occupying port 80.
  • Make sure the HTTP VirtualHost serves the ACME challenge path and that a redirect or access rule does not reject it.
  • If port 80 cannot be made reachable, switch to DNS-01 rather than repeatedly retrying HTTP-01.

Certificate-name mismatch

Compare the hostname in the browser address bar with Apache’s ServerName, any ServerAlias, DNS records, and the certificate SAN list. Request a new certificate containing every legitimate name; do not rely on a certificate for a visually similar domain or parent domain.

Apache shows the wrong site or certificate

Inspect enabled sites and all HTTPS VirtualHosts. A request that does not match the intended host can land on the default site. Correct the host name, enable the intended site, disable obsolete conflicting hosts where appropriate, run sudo apache2ctl configtest, and reload Apache.

Renewal succeeds but the old certificate remains visible

Check the certificate files referenced by the active HTTPS VirtualHost and reload Apache. Certbot-managed Apache services are normally reloaded automatically; manually managed services require an explicit deploy hook or reload action. Confirm the certificate again from an external browser after the reload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTPS works but database traffic is not protected

Review phpMyAdmin’s database SSL settings and the MySQL/MariaDB server’s TLS requirements independently. Enable the SSL option, install the correct CA, decide whether server verification is mandatory, and configure client certificates if mutual TLS is required. Browser certificate success alone provides no evidence about the database hop.

Operational checklist

  1. Choose one exact FQDN and create the required A/AAAA records.
  2. Verify the name resolves publicly to the Ubuntu server and expose TCP 80 for HTTP-01, or prepare DNS-01.
  3. Enable mod_ssl with sudo a2enmod ssl.
  4. Ensure the HTTPS VirtualHost contains the phpMyAdmin alias and the matching ServerName.
  5. Install Certbot and run sudo certbot --apache -d your-real-name, or use certonly and set paths manually.
  6. Run sudo apache2ctl configtest, then sudo systemctl reload apache2.
  7. Redirect ordinary HTTP requests while preserving ACME challenge access.
  8. Test the login flow at the exact HTTPS hostname and inspect the certificate SAN and expiry.
  9. Run sudo certbot renew --dry-run and monitor the twice-daily renewal timer.
  10. Configure phpMyAdmin’s database TLS settings separately when the MySQL/MariaDB connection needs encryption or identity verification.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.