Purchase a HostGator Self-Managed VPS with Magento 2 Installation
Retailers who need a store that behaves exactly as they design it, rather than working within someone else's template, tend to land on Magento 2. That level of control over appearance, speed, and growth only holds up on the right infrastructure, which is why a Self-Managed VPS pairs well with it: no other accounts sharing your resources, and full room to tune the server to match how your store actually runs.
Below, you'll find why Magento 2 stands out, where it's commonly used, and how to purchase and set up a VPS to run it. For a deeper dive into the platform itself, see What is Magento 2? A Complete Overview.
Key Benefits of Magento 2
Magento 2 lets you build a store that's fully your own, with the customization and scale to match. Product, customer, and order management all go deeper than what most out-of-the-box platforms offer. Here's where that shows up:
- Handles large product catalogs without slowing down as your business grows.
- Holds up under high sales volume and traffic spikes.
- Leaves room for custom features and integrations built around exactly what your business needs.
What You Can Do With Magento 2
From a single storefront to a full multi-brand operation, Magento 2 bends to whatever shape your online retail business needs.
- Multi-Store Management: Run multiple storefronts, brands, or regional sites from one admin panel.
- B2B and B2C Sales: Handle complex pricing, quotes, and bulk orders right alongside standard retail checkout.
- Product Merchandising: Drive sales with promotions, cross-sells, upsells, and personalized recommendations.
- Custom Integrations: Connect payment gateways, shipping providers, ERPs, and marketing tools through Magento's extension ecosystem.
- Content-Rich Storefronts: Build custom themes and landing pages that match your brand, with no locked-down template holding you back.
Whichever use case fits your business, Magento 2 gives you the room to customize and scale your store as you grow.
How to Purchase a Self-Managed VPS with Magento 2 Installation
To use Magento 2 on HostGator, you first need to buy a Self-Managed VPS plan. Here is how to do it:

Not sure which VPS setup is right for you? That's exactly what Pre-configured Setup is for. You'll find this option near the top of the HostGator Self-Managed VPS purchase page, and it takes the guesswork out of getting started. Just tell us what you're building—a WordPress Site, an AI Agent/Claude Code project, a Dev/Staging environment, or an eCommerce Store—and we'll automatically select the right plan, operating system, and template to match.
- Great option if you're new to VPS or want a fast, easy setup
- Get the recommended configuration for your project right away
- No need to figure out the technical details yourself
- Full flexibility to adjust settings later on
- Open https://www.hostgator.com/vps-hosting in your browser.
- Pick the plan you want and click Choose Plan.

Important: Pricing is subject to change—please visit https://www.hostgator.com/vps-hosting for the current introductory/sign-up offer for HostGator VPS Hosting. For the most up-to-date renewal pricing, visit your HostGator Customer Portal Renewal Center.
- Pick a Data Center location.

- On the Cart page, you can set up your server the way you want:
- Hardware:
- Pre-selected:
You can change to a different Self-Managed VPS plan here.

- Configure:
Click Configure if you want to build your own custom package.
Note: Any changes you make here will change the total price.

- Pre-selected:
- Software:
If the selected plan does not meet the app's minimum requirements, the app will be grayed out.
- Click the Application tab.
- Choose Magento.

- In the pop-up, click Confirm.

- Hardware:
- Support & Security:
You can add Premium Support here for faster help and quicker replies. This is Optional.

- AI Credits:
Add a HostGator AI Credits package to connect your application to top LLM providers through one API key and a single bill. This step is optional.

- In Advanced options, you can set these up if you want:
- Extra IPs: Add more IP addresses for an extra cost. The price changes based on how many you add.
- Hostname: Give your server a custom name. This is optional.
- SSH Key: If you want to log in without a password, add your SSH public key here. This is optional.

- Choose a billing term, check your Order Summary, then click Continue to Checkout.

- Check your HostGator cart. Remove any add-ons you don't want, then click Continue to Checkout again.

- On the Checkout page, do the following:
If you are new to HostGator:
- Fill in your billing information and contact details. If you don't want marketing emails, uncheck the box at the bottom.

- Create a password for your account.

- Choose how you want to pay—Credit Card or PayPal—and enter your payment details.

If you already have an account, your HostGator login details will show up once you log in to your Customer Portal. If you are not logged in, click Log In.

- Fill in your billing information and contact details. If you don't want marketing emails, uncheck the box at the bottom.
- Review your payment method and order total. If you have a promo code, click Add Promo Code and enter your code. If you need to make changes, click Edit or Add Payment Method. When everything looks correct, click Submit Payment to complete your purchase. By clicking Submit Payment, you agree to the Auto Renewal Terms, Terms of Service, Cancellation Policy, and Privacy Notice.

After checkout, your Self-Managed VPS will begin setting up. Once it’s ready, you can find it under the Hosting tab in your Customer Portal.
Getting Your Magento 2 Server Ready
Your new server ships ready to go, with Magento 2, Nginx, PHP 8.3, MySQL, and OpenSearch already installed. This guide gets you logged in, your account locked down, and your own domain connected.
Step 1: Sign In and Access Your Credentials
Your temporary login details and admin URLs are stored right on the server, ready for you to pull up.
- Log in to your Customer Portal.
- From the left-hand menu, navigate to Hosting and select My Plans.

- Locate the server you want to manage, then click View Details in the bottom-left corner to expand the section and access additional server information.

- Click the Reset Password button.

- In the pop-up window, type your new root password, then click Reset Password again to confirm and save the changes.

- Connect to your server via SSH.
Open a terminal (or an SSH client like PuTTY) and log in as the administrator using your server's public IP address: Follow the prompts and enter the new root password you set in the step above.Replaceyour_server_ipwith your actual server IP address.ssh root@your_server_ipExample Output:
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 6.8.0-111-generic x86_64) ******************************************************************************** Welcome to your Magento 2 installation! Store URL: https://12.1.1.123/ Admin URL: https://12.1.1.123/admin_dqfm2f1 Admin user: testing Admin email: [email protected] Your admin login and service credentials are saved in the following file: /root/.app_passwords See /root/README.md for more information about using magento This prompt is shown automatically only once. To run it again later, execute: /root/domain_connect [d] — Connect a domain name to magento (nginx + SSL will be updated for that host) [i] — Keep using the server's IP address (current behavior) [q] — Quit Your choice [d/i/q]:Pick whichever option matches what you're trying to do:
Your choice [d/i/q]- Press i – Use Server IP (Recommended)
Wraps up setup right away using your server's IP address (12.1.1.123). Nothing stops you from switching to a custom domain down the road. - Press d – Connect a Domain
Pick this only if you already own a domain (e.g.,myshop.com) and its DNS is already pointed at12.1.1.123. The script will ask for your domain and set up an SSL certificate for it. - Press q – Quit
Exits the installer and drops you at the command line. You can bring the wizard back anytime with/root/domain_connect.
Type i, d, or q, then press Enter.
- Press i – Use Server IP (Recommended)
- Need to look back at the deployment notes without leaving your terminal? Print the original README file with:
cat /root/README.md
- View your credentials:
cat /root/.app_passwords
Example Output:
root@server-123456:~# cat /root/.app_passwords root_mysql_pass="testonly785d3f281c50ec9ddfba60ee80" admin_mysql_pass="testonly23abd5395b9b82cea14cbf73" app_mysql_pass="testonlye73e35703437ccf4a013f95" opensearch_pass="testonly!^*SF)3^Gd" magento_admin_pass="testonlyb6e4f716bdec7419c06404a3" [email protected] magento_admin_user=testing magento_admin_pass=testonly6e4f716bdec7419c06404a3 magento_admin_url=https://12.1.1.123/admin_dqfm2f1 magento_store_url=https://12.1.1.123/
Step 2: Log Into Your Magento Admin Panel
Pull up the admin URL from the previous step in your browser, then sign in with the default admin username and the password from your credentials file.
- Store URL: https://your-ip-address/
Replace
your_server_ipwith your actual server IP address.
- Admin URL: https://your-ip-address/admin_dqfm2f1
Replace
your_server_ipwith your actual server IP address.
Step 3: Secure Your Admin Account
Before going further, set up your own administrator account and get rid of the default one that ships with the install.
- Run the user creation script in your terminal:
Answer the prompts to set your username, password, and email.
/root/user_createExample Output:
root@server-123456:~# /root/user_create --- New Magento admin account --- First name [q=quit]: Test Last name [q=quit]: Account Email address [q=quit]: test [email protected] Admin username (letters, digits, underscore only) [q=quit]: jc Admin password: at least 12 characters with upper and lower case, a digit, and one of !@#$%^&* — or press Enter or type r to generate a random password. Password [Enter/r=random, q=quit]: Remove the existing admin user 'testing' after creating 'jc'? If you choose no, both accounts will remain. [y] — Remove the old admin after creating the new one [n] — Keep the old admin and add the new account [q] — Quit Your choice [y/n/q]: y - Back in your Magento Admin Dashboard, log out of the default account and sign back in with the credentials you just created.

- Once you're logged in with your new account, go to System ➔ Permissions ➔ All Users, find the default admin user, and delete it to lock down your store.

Step 4: Connect Your Domain and Set Up HTTPS
Right now your site answers to the raw server IP. Here's how to point your actual domain at it instead:
- Update your DNS: In your domain registrar's settings, point your domain's A Record to your server's primary IP address.
- Give DNS time to propagate.
- Once your domain resolves to the server, run the built-in connection script as root:
/root/domain_connect
- Enter your domain when prompted, and the script handles the rest: updating Magento, configuring Nginx, and installing a free Let's Encrypt SSL certificate.
Note: If the Let's Encrypt step fails, or you need to force a renewal later, run this command (swap in your own domain and email):certbot --nginx -d yourdomain.com -m [email protected] --non-interactive --agree-tos --force-renewal
Step 5: Set Your Store's Email Addresses
The installer sets a placeholder email address ([email protected]) by default. Swap that out so system and order notifications actually reach you.
- Log into your Magento Admin Dashboard.
- Update Store Emails: Go to Stores ➔ Configuration ➔ General ➔ Store Email Addresses and replace the placeholder addresses with your own.
- Update Admin Account Email: Go to System ➔ Permissions ➔ All Users, open your user profile, and confirm your admin email is correct.
Essential Magento 2 Maintenance Routines
A built-in shortcut alias (magento) means you don't need to keep switching users just to manage your store. Run these any time you make layout or configuration changes:
Flush Cache:
Reindex Data:
Additional Information and Examples
You can run cat /root/README.md to see more information and useful commands:
root@server-123456:~# cat /root/README.md
# Magento
## Description
Magento 2 is a self-hosted, PHP e-commerce platform for stores that need more
than a simple shop-in-a-box: you own the code, themes, and extensions, and you
are not tied to a closed SaaS product.
It shines when you need **scale and flexibility**-one admin for multiple
stores, strong catalog and order workflows, merchandising (promotions,
cross-sells), and integrations for search, checkout, and marketing-backed by
a large extension ecosystem and solid vendor documentation.
## Services
Service | Ports | Purpose
----------------|-------|---------
OpenSSH | 22 | SSH
Nginx | 80/443| Magento
OpenSearch | 9000 | Magento Search
Ports are protected using ufw.
## How-to-use
On first boot, Magento is installed automatically using the server's
primary IP as the site URL. A Let's Encrypt certificate is requested
and installed for that address so HTTPS works out of the box. A
default Magento user is created so the installation can
finish. **Create your own administrator account** by running
`/root/user_create`. **You should remove the default admin** once your
account is in place.
### Custom domain and HTTPS
To point Magento at your own hostname, run **`/root/domain_connect`** as **root** (same as `python3 /root/domain_connect`). The script updates Nginx and Magento base URLs and (re)issues TLS for the chosen host.
**First SSH session:** The same wizard runs **automatically once** when you first log in as root-root's `.bashrc` starts it and records that it has run, so you are prompted immediately. **Later sessions:** Run `/root/domain_connect` yourself whenever you want to switch between a domain and the server IP or change the hostname.
**Let's Encrypt vs self-signed** (see `create_nginx_config` in `/opt/magento_util.py`):
- **Domain name (not an IP literal):** If **DNS for that name resolves to this server's primary IP**, the tool uses **Let's Encrypt** (`certbot` with the nginx plugin). If **DNS does not** resolve to this server yet, a **self-signed** certificate is generated so HTTPS can still be enabled until DNS is correct (you can run `/root/domain_connect` again after DNS propagates).
- **Primary IP as hostname:** When you keep using the IP and the hostname is that IPv4 address, **Let's Encrypt** is requested with Certbot's **IP certificate** flow (`certonly` / short-lived profile).
- If a Let's Encrypt request **fails** while DNS already points at this host (or in the IP flow), Certbot errors are surfaced and the script **does not** silently fall back to self-signed in those paths-fix DNS/rate limits/etc. and re-run.
This server is provisioned with **Magento 2** under `/home/magento/www` (web root: `/home/magento/www/pub`). The stack includes **Nginx**, **PHP 8.3** (FPM), **MySQL** (database `magento`), and **OpenSearch** for catalog search.
## First-boot installation
On first boot, cloud-init runs `/root/magento_install.py` as **root**. That script:
- Uses this machine's **primary IPv4 address on `ens3`** as the hostname for the initial **HTTPS base URL** and for **Nginx** `server_name`.
- Creates a **self-signed TLS certificate** and an **Nginx virtual host** (HTTP redirects to HTTPS).
- Runs **`bin/magento setup:install`** as the `magento` user, deploys static content, then records **admin credentials** and URLs.
You do not need to run `magento_install.py` yourself unless you are re-running or troubleshooting an install (it must be run as root).
## Where to find passwords and URLs
- **`/root/.app_passwords`** - MySQL app password, Magento admin password, admin URL, and related values.
- **`/etc/update-motd.d/99-magento`** - Shown when you log in via SSH: store URL, admin URL (path only; no password), admin user, and a pointer to the password file.
## Magento CLI
As root, the shell alias **`magento`** runs CLI commands as the `magento` user, for example:
```bash
magento cache:flush