How7o
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Reading: How to Auto-start Apache and MySQL with XAMPP on Windows
Share
How7oHow7o
Font ResizerAa
  • OS
Search
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Follow US
© 2024–2026 How7o. All rights reserved.
How7o > Free Laravel, PHP, WordPress & Server Tutorials > OS > How to Auto-start Apache and MySQL with XAMPP on Windows
OS

How to Auto-start Apache and MySQL with XAMPP on Windows

how7o
By how7o
Last updated: May 22, 2026
5 Min Read
XAMPP autostart Apache and MySQL on Windows — XAMPP Control Panel and services
SHARE

To auto-start Apache and MySQL with XAMPP on Windows, you have two options: enable the Autostart checkboxes in the XAMPP Control Panel (plus a startup shortcut), or install Apache and MySQL as proper Windows services. Both work; services are more bulletproof because they start before login and survive logouts. This guide covers both methods, plus how to undo each.

Contents
  • Method 1 — Autostart inside the XAMPP Control Panel
  • Method 2 — Install Apache and MySQL as Windows services
  • Undo Method 2
  • Frequently asked questions
  • Related guides
  • References

Last verified: 2026-05-17 with XAMPP for Windows 8.2.x. Originally published 2022-12-10, rewritten and updated 2026-05-17.

Method 1 — Autostart inside the XAMPP Control Panel

  1. Right-click the XAMPP Control Panel shortcut → Run as administrator (required so XAMPP can save the config).
  2. Click the Config button (top right of the panel).
  3. Under Autostart of modules, tick Apache and MySQL.
  4. Click Save.

Apache and MySQL will now start every time you launch the XAMPP Control Panel. To also launch the panel when Windows starts:

  1. Press Win+R, type shell:common startup, hit Enter.
  2. A Startup folder opens.
  3. Right-click a blank area → New → Shortcut → point it at C:\xampp\xampp-control.exe → Finish.
  4. Right-click the shortcut → Properties → Advanced → tick Run as administrator.

Reboot. The Control Panel launches and starts Apache + MySQL automatically.

XAMPP autostart Apache and MySQL on Windows — two methods compared

Method 2 — Install Apache and MySQL as Windows services

Cleaner, more bulletproof: register both as proper Windows services. They start before any user logs in and run under the SYSTEM account.

First, stop both modules in the XAMPP Control Panel (you can’t install a service while the binary is already running).

Open cmd as Administrator:

:: Install Apache as a service
cd C:\xampp\apache\bin
httpd.exe -k install

:: Install MySQL as a service
cd C:\xampp\mysql\bin
mysqld.exe --install

Either reboot, or open services.msc and start Apache2.4 and mysql manually. After that they’ll auto-start on every boot. The XAMPP Control Panel will show a green check next to the Service column once each is registered.

Undo Method 2

:: Run cmd as Administrator
cd C:\xampp\apache\bin
httpd.exe -k uninstall

cd C:\xampp\mysql\bin
mysqld.exe --remove

Frequently asked questions

Service install vs. Autostart checkbox — which should I pick?

If you want Apache and MySQL running without ever opening the XAMPP Control Panel, install them as Windows services (Method 2). They’ll start before login, run under the SYSTEM account, and survive logouts. If you’d rather see the XAMPP control panel and have it auto-start the modules when you log in, use the Autostart checkbox method (Method 1) plus the shell:common startup shortcut. Both are valid; services are the ‘set it and forget it’ option.

My Apache or MySQL service won’t start after install — what now?

Most often, another service is already bound to the port (80/443 for Apache, 3306 for MySQL). Skype, IIS, World Wide Web Publishing Service, or a previous MySQL install are typical culprits. Run netstat -ano | findstr :80 and netstat -ano | findstr :3306 to find the PID using the port, then stop or uninstall the offender. Restart the XAMPP service afterwards.

Do I need to run as Administrator?

Yes for the install steps (httpd.exe -k install and mysqld.exe --install) — service registration requires admin privileges. After install, the services run as SYSTEM, so day-to-day use doesn’t need admin. The Autostart checkbox in the XAMPP control panel also needs admin to be saved persistently.

How do I uninstall the services later?

Run cmd as Administrator. For Apache: cd C:\xampp\apache\bin then httpd.exe -k uninstall. For MySQL: cd C:\xampp\mysql\bin then mysqld.exe --remove. The XAMPP control panel’s Service column will go back to the red X afterwards.

Will the autostart still work after a Windows update?

The services persist across normal Windows updates and reboots. Feature updates (Windows version upgrades) sometimes reset Service start-types to Manual — if the modules stop auto-starting after a big update, open services.msc, find Apache2.4 and mysql, and set Startup type back to Automatic.

Related guides

  • How to Access MySQL from Command Line in XAMPP on Windows
  • How to cd to a Different Drive in Windows

References

XAMPP on Windows FAQ: apachefriends.org/faq_windows.html. Apache httpd.exe service options: httpd.apache.org/docs/2.4/platform/windows.html.

TAGGED:Apacheconfigurationmysqlwindowsxampp

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article Select2 auto-focus on page load — .select2('open') How to Auto-focus a Select2 Dropdown on Page Load
Next Article Break out of a jQuery .each() loop with return false How to Break Out of a jQuery .each() Loop
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

FacebookLike
XFollow
PinterestPin
InstagramFollow
Most Popular
Set vi as the default editor in Ubuntu — a terminal opening the vim editor
How to Set vi (Vim) as the Default Editor in Ubuntu
June 8, 2026
rsync says ALL DONE but files are missing — a terminal showing ALL DONE next to an empty folder
rsync Says “ALL DONE” but Files Are Missing: How to Verify
June 8, 2026
Migrate a website to a new server with rsync — files copying from an old server to a new one over SSH
How to Migrate a Website to a New Server With rsync
June 8, 2026
Bun runtime — faster JS toolkit replacing npm in Laravel projects
How to Install Bun Runtime on Ubuntu (And Use It in a Laravel Project)
May 24, 2026
Tailscale mesh — peer-to-peer connections between devices, coordination server
How to Install Tailscale on Ubuntu (Zero-Config Mesh VPN for Self-Hosters)
May 24, 2026

You Might Also Like

WireGuard encrypted tunnel between server and clients with lock icons
Server Management

How to Set Up WireGuard VPN on Ubuntu (Server, Linux Client, and iOS)

10 Min Read
mysqldump all databases — export and import commands
Server Management

How to Export and Import All MySQL Databases at Once

6 Min Read
MariaDB not starting — six-step triage from logs to stale PID
Server Management

How to Troubleshoot MariaDB Not Starting

8 Min Read
Run a Linux cron job as a non-root user
Server Management

How to Run a Cron Job as a Non-Root User

5 Min Read
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Tools

  • Age Calculator
  • Word Counter
  • Image Upscaler
  • Password Generator
  • QR Code Generator
  • See all tools→

Pranks

  • Fake Blue Screen Prank
  • Hacker Typer
  • Fake iMessage Generator
  • Windows XP Crash Prank
  • Windows 11 Update Prank
  • See all prank screens →

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service
  • Sitemap
© 2024–2026 How7o. All rights reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?