Learning Hub · Advanced · one hour
How to Install a LAMP Stack
Linux, Apache, MySQL, PHP — serving from a bare VPS — a practical, no-jargon walkthrough with the classic mistake flagged before you make it.
The short answer
In one line: Linux, Apache, MySQL, PHP — serving from a bare VPS — a advanced-level job taking one hour.
The walkthrough below covers each step, the mistake most people make, and the shortcut worth knowing. On HostingAlly plans, several of the steps are handled for you — we note where.
Advanced
Difficulty
one hour
Time needed
5
Steps
24/7
Help if you're stuck
This guide assumes no prior expertise — just a hosting account, a browser, and one hour of attention. Every instruction works on our platform exactly as written, and translates to any standard cPanel host.
One promise before starting: nothing in this guide is irreversible. Where a step could bite, we say so and give the undo.
The route map
Start to finish, you'll install the trio, secure the database, configure the virtual host, add ssl with certbot and verify with a php test page.
Each stage is a few minutes of focused clicking — the elapsed time mostly depends on how familiar the control panel already feels. The detailed steps are listed further down this page; skim the whole route once before starting.
Where this goes wrong (and how to not)
The forgotten phpinfo.php — the test file that proved the stack works stays public, cataloguing versions and paths for anyone who looks; verification files are for deleting.
Forewarned is genuinely forearmed here — this exact mistake accounts for most of the frustration this topic produces, and it's entirely avoidable once named.
From the support desk: the shortcut
Consider whether you want this hand-built at all — a control panel (or our managed options) automates the stack's care; hand-built LAMP is superb for learning and control, and it makes every future update your job.
It costs a minute now and repays it every time this task comes around again — which, like most hosting tasks, it will.
What's automated here
Several steps in this guide exist because hosting historically made you do them — on our plans, SSL issues itself, backups run daily without being asked, and one-click installers replace manual setup entirely. What remains is the genuinely-yours part of the task.
Stuck mid-task at an odd hour? That's what 24/7 human support is for — describe where you are in this guide and we'll take it from there.

The platform this guide assumes
Every walkthrough in our Learning Hub is tested on the platform we actually run — cPanel, LiteSpeed, NVMe, one-click installs — so instructions match your screen instead of gesturing at it.
Daily automatic backups with one-click restores come with every plan.
- Step-by-step, tested as written
- The gotcha flagged before you hit it
- Automation covers the boring steps
- 24/7 support if you get stuck
Why HostingAlly
What you get with every plan
Written from real tickets
Our guides come from the support desk — the gotchas are the ones people actually hit.
Works as written
Every step tested on our own platform — no 'your host may vary' hand-waving.
Automation where it belongs
SSL, backups and installs run themselves here — the guide covers only what's genuinely yours to do.
Help on standby
Stuck at step three at midnight? Support answers around the clock, mid-guide included.
The undo is always named
Where a step could bite, the guide says so and gives the reversal.
No jargon tax
Terms are explained in place or linked to the glossary — nothing assumes you already know.
Getting Started
How to get going
- 1
Install the trio
Apache, MariaDB/MySQL and PHP-FPM with common extensions from the distro repos — one package-manager line per component on a fresh server.
- 2
Secure the database
mysql_secure_installation sets the root password and strips test artefacts — the two-minute step that shouldn't be skipped.
- 3
Configure the virtual host
A site config mapping your domain to its document root, enabled and reloaded — Apache now answers for the name, not just the IP.
- 4
Add SSL with certbot
Let's Encrypt's certbot issues, installs and schedules renewal in one command — HTTPS from the first hour, self-maintaining.
- 5
Verify with a PHP test page
A phpinfo file confirms the full chain (then delete it — it advertises configuration detail attackers enjoy reading).
Included
What's covered on our plans
- Free domain for the first year on annual plans
- 99.9% uptime commitment, monitored around the clock
- One-click installer for WordPress and 400+ apps
- Free SSL certificate on every plan, renewed automatically
- LiteSpeed server-level caching
- cPanel — the industry-standard control panel
- Per-site PHP version selection
- No setup fees, ever
- Free website migration handled by our team
- SSH, Git and Composer access on developer-friendly plans
FAQ
Your questions, answered
Apache or nginx for the web server?
Both are excellent — Apache's .htaccess flexibility suits shared-style workflows and most tutorials; nginx's model shines under high concurrency. For a first VPS stack, Apache's documentation gravity makes the smoother road.
How do I add more sites to the same VPS?
Additional virtual hosts — each domain gets a config block and document root on the same stack. One VPS happily serves many modest sites; resource contention, not configuration, sets the practical limit.
What does your 24/7 support actually cover?
Real people at every hour, and a scope that includes the practical questions — email setup, DNS, WordPress issues, restores — not just 'the server is up, ticket closed'. Pre-sales questions are welcome too; ask us something difficult and judge the reply.
Can I host more than one website on a plan?
On the Pro tier and above, yes — multiple sites with their own domains, email and SSL under one account. If the extra sites belong to clients rather than you, reseller hosting gives each one proper isolation instead.
Are backups included, and can I restore them myself?
Daily automatic backups are standard, restorable from the panel in minutes — files, databases or both, at 3am without a ticket if that's when you need it. For extra cover, you're welcome to run your own offsite copies alongside.
How long does it take to get started?
Minutes — hosting activates on payment, the domain (free for year one on annual plans) connects immediately, and one-click installers put WordPress or 400+ other apps live the same sitting. If you have an existing site, our team migrates it free, usually within 24 hours.
Do prices go up at renewal?
No — the price you sign up at is the price you renew at. We don't run teaser-rate economics, so there's no year-two ambush to plan around, and your bookkeeping can rely on the number staying put.
Keep exploring
How to Stop a Domain Expiring
Make domain loss structurally impossible — beginner level, 10 minutes of setup, then never again.
How to Migrate a WordPress Site
Move a WordPress site between hosts with zero visitor-facing downtime — intermediate level, 1–2 hours (or a free ticket to us).
WordPress Hosting
Managed WordPress with LiteSpeed caching, staging and automatic backups.
Web Hosting
NVMe cPanel hosting with free SSL, migration and a free first-year domain.
Get online without the games.
Every plan includes the essentials others sell as extras — and support that actually answers.
See Hosting Plans