Learning objectives
After reading this article you will be able to:
- Understand how each model splits the server and who administers what
- Compare control, performance, security and cost side by side
- Decide which fits a website, an API or a bot
Anyone publishing a site or an app soon meets two cheap options: shared hosting and a VPS. The prices look similar, but what each one delivers is very different, and the wrong choice costs time or flexibility.
The core difference is how much of the server is yours. On shared hosting you rent space on a divided server that the provider administers. On a VPS you rent a whole virtual machine and you are responsible for it.
What is shared hosting?#
It is a model where many websites run on the same physical server, and the cost of operating it is split among customers. Hardware and resources are shared, and the provider enforces usage limits.
The provider handles the operating system, the web server and security updates. You get a control panel (the provider's own or cPanel) to upload files and create databases and mailboxes. The typical stack is LAMP: Linux, Apache, MySQL and PHP.
The upside is simplicity: there is no server to configure. The cost is freedom, since you cannot install arbitrary software or tune the system.
What is a VPS?#
A VPS (Virtual Private Server) is a virtual machine carved out of a physical server shared among several customers. Each VPS has its own operating system, and you usually reach it over SSH with root permission. For the wider picture, see VPS, cloud and hosting platform compared.
You install the runtime, set up the reverse proxy, issue the TLS certificate, open only the ports you need and keep the process alive after a reboot. On Ubuntu Server, the unattended-upgrades package applies operating system security updates automatically, but your application, its dependencies and your database stay on you.
How do they compare side by side?#
| Criterion | Shared hosting | VPS |
|---|---|---|
| Who administers the server | The provider | You |
| System access | Control panel and file upload | Root, usually over SSH |
| Software you can run | What the provider offers (usually PHP and MySQL) | Anything compatible with the OS |
| Long-running processes (bot, WebSocket) | Usually not | Yes |
| Resource isolation | Weak: the server is divided and usage is limited | Stronger: the CPU and RAM you buy are yours |
| Knowledge required | Low | Linux, networking and security |
| Time to publish | Minutes | Hours, to set up the server |
| Cost | Lower | Higher, but fixed and predictable |
Providers differ. Some shared plans offer Node.js, and some VPS plans ship with a panel. The table describes the typical case, so check what your provider actually delivers.
Which one is more secure?#
It depends on who does the work. On shared hosting the provider applies fixes to the system and the web server, which lowers your risk if you are not comfortable with administration. In return, the server is shared with other sites and you do not choose the configuration.
On a VPS the isolation is stronger, but security is your job: firewall, updates, SSH key access, disabling password root login. An unpatched, forgotten VPS is an easy target. More control means more obligation.
Which one performs better?#
A VPS tends to be more predictable. The resources you bought are yours, so performance varies less. On shared hosting the provider caps CPU, memory and process counts to protect other customers, and a spike from neighbors can slow your site.
For a small site with little traffic the difference barely shows. It matters as traffic grows or when the app does constant background work. If your app is slow, diagnose it before changing plans: the bottleneck is often code or the database, not the server.
When should you choose each?#
Choose shared hosting when:
- it is a company site, a blog or a small PHP store such as WordPress;
- nobody on the team wants to administer a server;
- you want a ready panel with mail and a database included;
- budget is the main factor and traffic is low.
Choose a VPS when:
- you need root access or software the shared provider does not offer;
- you will run a continuous process such as a bot, an API or a game server;
- you need reserved resources and steady performance;
- you want to learn server administration, which is valuable on its own.
If VPS price is the open question, see what a VPS costs before deciding. And remember that hosting and a domain are separate things: you can point the same domain at either one.
Is there a middle ground?#
Yes. Between shared hosting (little control, no administration) and a VPS (full control, full administration) sit cloud hosting platforms, where your code runs in a container and the operating system underneath is not your problem. See what cloud hosting is. For a bot or an API, this path often solves the problem without making you a sysadmin.
How to do this on Square Cloud#
Square Cloud is neither PHP-panel shared hosting nor a VPS: it is self-service hosting where you deploy and control the application, which runs in an isolated container that is always on, with no sleep mode. There is no operating system to administer.
You can deploy by uploading a ZIP in the dashboard, through the CLI, through GitHub (a push triggers the deploy, via the official GitHub Action or a webhook), or with the VS Code extension. There are several runtimes, such as Node.js, Python, Java, Go and Rust (see the ones available today on Runtimes), so long-running processes such as bots and APIs work. Environment variables live in the dashboard or API and apply on the next restart, with no rebuild. The plan's RAM is a pool shared across your applications, and vertical scaling is a RAM change in settings. There is no autoscaling.
Plans are paid and billed in reais, by Pix or card, starting at R$12.49 per month on Hobby. Daily application snapshots start on Pro.
The features page lists everything the platform includes, so you can check it against what your app needs.
Deploy
Push from GitHub, the CLI or a ZIP and go live in seconds
FAQs
Can I run a Discord bot on shared hosting?
Usually not. A bot is a process that must stay on all the time, and shared hosting is typically built for PHP and MySQL sites, without a way to keep a long-running process. Check your provider's terms before you buy.
Is a VPS faster than shared hosting?
It is usually more predictable. On a VPS the resources you pay for are yours. On shared hosting the server is divided and the provider enforces usage limits, so other sites can affect yours.
Do I need to know Linux to use a VPS?
Yes, the basics: SSH, installing packages, firewalls, processes and logs. A VPS gives you the machine and you administer it. On shared hosting the provider runs the server and you use a control panel.
Can I start on shared hosting and move to a VPS later?
Yes. Moving is easier if your configuration lives in environment variables and your database can be exported and imported.
More in Deploy
See all 33 articles- What are environment variables?Environment variables are key-value pairs the operating system hands to a process at startup. Learn to read them in Node.js and Python and keep tokens out of code.
- What is a deployment?A deployment takes a version of your code to a server, prepares it and starts it. See the stages, the methods and how to roll back when it goes wrong.
- How much RAM and CPU does my app need?Size RAM and CPU by measuring your app's real peak and adding about 30% headroom. Learn how to measure in Node.js, Python and Java and what to do if short.
- Automatic deploys with GitHub ActionsAutomatic deploys with GitHub Actions ship your code to the server on every push. See the workflow step by step, secrets, tests before deploy and common errors.