Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk13 min

How to Create Your Own Shared Hosting on a Linux VPS

A practical architecture for hosting multiple websites on one Linux VPS: isolate files with Linux users, run one PHP-FPM pool per site, map each virtual host to its own socket, and enforce filesystem quotas.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can host several independent websites on one Linux VPS by combining four layers: a separate Linux user and document root for each site, one PHP-FPM pool and private socket per site, a virtual host that targets the matching socket, and filesystem quotas for each account. The Linux users provide the real file boundary; PHP-FPM pools add process and configuration separation but are not, by themselves, a complete security boundary.

The architecture that makes one VPS behave like shared hosting

A shared-hosting arrangement on a VPS is a multi-tenant layout that you operate yourself. Every hosted site gets an account-like boundary while the websites share the VPS kernel, storage, web server and (unless you deliberately separate them) some PHP infrastructure.

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.
Layer Per-site item Purpose
Operating-system identity Unique Linux user and group Owns the site’s files and limits which account can read or write them.
Storage Dedicated document root, such as /var/www/site1 Keeps code, uploads and logs in a predictable location.
PHP execution One PHP-FPM pool with its own user, group and Unix socket Runs requests as the site’s account and allows per-site PHP limits.
HTTP routing One virtual host per domain Sends each domain’s PHP requests to the correct pool socket.
Capacity User (and optionally group) disk quota Stops one account from consuming all allocated blocks or inodes.

For example, a site account can own /var/www/site1, while its pool listens on /run/php/php8.3-site1.sock. A second account uses a different root and socket. The exact PHP version and service paths depend on your distribution; the paths below follow a Debian/Ubuntu-style PHP 8.3 layout shown in a community setup example.

What isolation you really get

Separate Linux users are the security boundary

Make a distinct, non-shared Linux account for every hosted site. Ownership such as siteuser1:siteuser1 on /var/www/site1 means that a process running as another site user cannot ordinarily modify those files. Separate users limit the blast radius if one application is compromised.

#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.

Do not run all sites as one generic account. If every document root is owned by the same user, a vulnerability in one application can usually alter the others, regardless of how many PHP-FPM configuration files you create.

PHP-FPM pools improve separation but are not a complete sandbox

A pool can run with its own user, group and listen socket, but pools still share the host and PHP’s OPcache instance. Pool separation should therefore be treated as process and configuration isolation, not as a full security mechanism. Keep the FPM sockets on a local Unix path; do not bind FPM to a publicly reachable address.

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

Plan the filesystem and accounts first

Choose a consistent layout

Use a repeatable naming scheme before adding domains. For example:

  • Linux account: siteuser1
  • Document root: /var/www/site1
  • Pool file: /etc/php/8.3/fpm/pool.d/site1.conf
  • Socket: /run/php/php8.3-site1.sock
  • Optional logs: a directory owned by siteuser1, separate from other sites

Create the account and directory using your distribution’s normal user-management commands, then assign ownership recursively. The important result is equivalent to:

sudo chown -R siteuser1:siteuser1 /var/www/site1

Keep administrative files outside the web root where possible. Ensure that uploads and files created by PHP are also owned by the site account; otherwise a user quota will not represent that site’s actual storage.

Put quota-enabled storage in your plan

Quotas apply to a filesystem, not to an arbitrary directory. Decide whether the sites live on /home, a dedicated partition, or another filesystem, and identify its device and type before editing mount options. The quota syntax differs between ext4 and XFS, so copying an ext4 option string onto XFS can prevent the next boot.

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

Create one PHP-FPM pool per site

Write a pool configuration

On Debian/Ubuntu-style systems, pool files are kept in /etc/php/8.3/fpm/pool.d/ in the cited example. A minimal pool needs a unique pool name, account, group and socket:

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.
[site1]
user = siteuser1
group = siteuser1
listen = /run/php/php8.3-site1.sock

pm = dynamic
pm.max_children = 10

The pm.max_children = 10 value is an example, not a universal recommendation. It caps concurrent PHP worker processes for that pool; choose a value that fits the VPS memory and the application’s workload. Add a second pool with a different section name, account and socket for every additional site.

Add per-site PHP restrictions carefully

Community configurations commonly add pool-level administrative values such as:

php_admin_value[open_basedir] = /var/www/site1:/tmp
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,popen

open_basedir limits PHP file access to the site directory and temporary storage. The listed execution functions block several ways PHP code can launch commands. These are configuration examples rather than guaranteed defaults, and the exact directive behavior must be checked against the PHP and distribution versions you run. Applications that legitimately require a disabled function or a path outside the allow-list will fail until you adjust the policy.

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

Validate and reload

  1. Check the pool file for syntax errors with the PHP-FPM test command supplied by your distribution.
  2. Reload or restart PHP-FPM only after every pool file passes validation.
  3. Confirm that each expected socket exists under /run/php/ and is owned or permissioned so the web server can connect while unrelated users cannot.
  4. Inspect the service log if a pool refuses to start; a duplicate pool name, misspelled directive or unwritable socket directory is a common cause.

Point each virtual host at its own socket

Create one virtual host for each domain. The web server serves that site’s document root and sends PHP requests through the matching FastCGI socket. A separate pool per virtual host is the usual way to obtain a separate socket per site.

The critical mapping is one-to-one:

Domain Document root FastCGI socket
site1.example /var/www/site1 /run/php/php8.3-site1.sock
site2.example /var/www/site2 /run/php/php8.3-site2.sock

Apache with PHP-FPM is documented in an Ubuntu setup guide, and nginx can also pass requests to PHP-FPM through FastCGI. The available material does not establish a performance winner between them, so choose the server you already administer confidently. Whichever server you use, verify that the virtual host for site1 cannot accidentally reference site2’s socket.

Test the routing before adding real applications

  1. Place a small PHP test file in each site’s root that prints a distinctive value, then request each domain separately.
  2. Confirm the response comes from the expected site and that the PHP process is running as the expected Linux account.
  3. Remove the test file after verification.
  4. Check access and error logs for the correct per-site paths if you configured separate log directories.

Enable per-user disk quotas

Quotas protect storage, not CPU or memory. They are useful only when site data is owned by the limited account, and they must be enabled on the filesystem that actually contains the sites.

1. Install quota tools

On Debian/Ubuntu, install the distribution’s quota package. Package names and service integration can differ on other systems.

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

2. Add the correct mount options

Edit /etc/fstab for the sites’ filesystem. An ext4 example for a dedicated /home filesystem is:

/dev/sda3 /home ext4 defaults,usrquota,grpquota 0 2

Use usrquota for per-user limits and grpquota when you also need group limits. Remount the filesystem after editing, or reboot during a planned maintenance window. Before rebooting, verify that the options are valid for that filesystem.

3. Create quota metadata

On a fresh setup, build the quota files with a command such as:

sudo quotacheck -vguma

Quota files may be named aquota.user, quota.user, aquota.group or quota.group, and are stored at the filesystem root. Do not assume the filename from another distribution.

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

4. Turn quotas on

sudo quotaon -avug

Confirm the active state with:

sudo quotaon -pug /home
findmnt -no OPTIONS /home

5. Assign limits

setquota is convenient for scripts; edquota opens an interactive editor. The setquota form supplies the account name, block soft and hard limits, inode soft and hard limits, and the filesystem. A schematic command is:

sudo setquota <user> <block-soft> <block-hard> <inode-soft> <inode-hard> <filesystem>

Use the exact unit and argument order documented by your installed version before applying production limits. A soft limit permits a grace period or warning behavior, while a hard limit is the ceiling enforced by the filesystem.

6. Audit the result

sudo repquota /home
sudo repquota -n /home

The -n form skips name lookups and can be faster on large systems. Test by creating files as the site account and checking that usage appears under the intended user. If uploads are written by a different account, the quota will undercount that site’s data.

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.

Journaled quotas, ext4 features and XFS differences

Journaled ext4 quota options

Journaled quota configurations for ext3/ext4 may use options such as usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0. Their advantage is that an unclean shutdown does not require the same post-crash quota scan. Newer ext4 installations can instead use the filesystem’s built-in quota feature, enabled with tools such as tune2fs.

Sources disagree about combining the ext4 feature with fstab quota options, and a kernel change caused ext4 to ignore quota mount options when the quota feature is enabled. Follow the documentation for your distribution and kernel rather than combining examples blindly.

XFS uses different option names

XFS uses uquota or usrquota for users, gquota or grpquota for groups, and pquota or prjquota for projects. An ext4 line copied unchanged to XFS can fail at the next boot. Identify the filesystem with findmnt and use its native quota procedure.

Compare account layouts before you deploy

Layout Isolation strength Administration Resource control
One Linux user for every site Weak: a compromised site can generally alter sibling sites owned by the same account. Simple initially, difficult to audit safely as sites grow. No meaningful per-site file quota or process boundary.
Separate users, shared PHP pool Better file ownership, but PHP execution and limits are shared. Less pool configuration, but less precise troubleshooting. Storage quotas are possible; PHP worker limits are shared.
Separate users and separate pools Strongest layout in this design: file permissions plus per-site PHP processes, while the VPS kernel remains shared. More files, sockets and checks to maintain. User/group quotas plus pool-level worker and PHP settings.

The third layout is the practical target when you need to host unrelated sites. It costs more administrative effort because every new domain requires an account, directory, pool, socket, virtual host and quota record. In return, a mistake or compromise is easier to confine to one account. A control panel may automate some tasks, but its licensing, security model and operational tradeoffs must be evaluated separately; automation does not remove the need to understand ownership, sockets and filesystem quotas.

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.

Operational details that prevent cross-site mistakes

  • Keep names mechanically related. Derive the user, root, pool section, socket and log directory from one site identifier. This makes a wrong socket or ownership assignment easier to spot in review.
  • Check parent-directory permissions. Correct ownership on /var/www/site1 is not enough if a parent directory denies traversal or grants unintended access.
  • Protect the socket path. A Unix socket should be reachable by the web server but not exposed over TCP to the network. A public FPM listener can turn a local service into a remotely reachable attack surface.
  • Apply restrictions per site. Put open_basedir and disable_functions in the affected pool, then test the application. A global restriction can break every customer at once.
  • Keep quota ownership consistent. If a deployment job, cron task or web-server process creates files as another user, those blocks and inodes are charged elsewhere. Correct the writer’s identity or account for the difference when setting limits.
  • Record the mapping. Maintain a simple inventory of domain, Linux user, root, pool file, socket, filesystem and quota. This is invaluable when removing a site or recovering a failed service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Resource controls beyond storage

Disk quotas do not stop a site from exhausting RAM, CPU time or PHP workers. PHP-FPM’s per-pool process settings provide a second control surface. For example, pm.max_children limits simultaneous workers for one pool. Lower values reduce the chance that one account consumes every PHP process, but values that are too low create queueing and slow responses.

  • Set a pool-specific worker ceiling based on available memory, not a copied number.
  • Keep each site’s socket and pool name unique so a change affects only its account.
  • Watch logs and system metrics for repeated worker exhaustion, long requests or out-of-memory kills.
  • Remember that all pools still share the VPS kernel and other host resources.

Common failure modes and recovery

502 or “connection refused” from the web server

  • Confirm PHP-FPM is running and the socket path in the pool exactly matches the virtual host.
  • Check that the socket directory exists after boot and that the web-server account has permission to connect.
  • Look for a pool syntax error or duplicate socket name in the FPM log.

One site can read another site’s files

  • Check ownership and permissions on every document root, including parent directories.
  • Ensure each pool’s user and group are unique.
  • Do not treat open_basedir as a replacement for Unix permissions; it is an additional PHP restriction.

PHP application breaks after restrictions are enabled

  • Review the application’s required directories against open_basedir.
  • Check whether it calls a function listed in disable_functions.
  • Relax only the affected site’s pool policy, then retest; do not remove restrictions globally without a reason.

Quota reports zero usage or refuses to start

  • Verify the mount contains the quota options with findmnt.
  • Run quotacheck on the correct filesystem and confirm quota files are at its root.
  • Use option names appropriate to ext4 or XFS; they are not interchangeable.
  • Check that files are owned by the limited site account.

The VPS becomes slow even though quotas are healthy

Quotas measure blocks and inodes only. Inspect PHP-FPM worker counts, memory pressure and application behavior. Reduce an abusive pool’s process ceiling, fix runaway requests and leave enough memory for the operating system and web server.

A repeatable onboarding checklist

  1. Identify the filesystem and confirm its quota method.
  2. Create a unique Linux user and group for the new site.
  3. Create the document root and assign recursive ownership to that account.
  4. Create a PHP-FPM pool with unique name, user, group and Unix socket.
  5. Set a measured pm.max_children value and any site-specific PHP restrictions.
  6. Create the virtual host and map its PHP handler to the matching socket.
  7. Validate and reload the web server and PHP-FPM.
  8. Request the domain, verify the executing account, and inspect logs.
  9. Apply user and (if needed) group quotas, then confirm with repquota.
  10. Record the account, root, socket, quota and recovery details for future maintenance.

Where this design stops

This arrangement gives you account-level file separation, per-site PHP processes and storage ceilings, but it does not create virtual machines. The sites still share the VPS kernel, base operating system, web-server installation and PHP-FPM infrastructure such as OPcache. Backups, monitoring, abuse response, billing, control-panel licensing and a provider’s rules about reselling or multi-tenant hosting require separate decisions that are not supplied by this architecture.

The practical rule is simple: use separate Linux users for the boundary, separate pools and sockets for predictable execution, and filesystem quotas for storage governance. Treat every distribution-specific command and quota option as something to validate on the exact Linux, PHP and filesystem versions you operate.

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

Frequently Asked Questions

Can PHP-FPM pools alone isolate websites?

No. Pools separate processes and settings, but they still share the VPS and one OPcache instance. Use a different Linux user and group for each site to create the file-level boundary.

Should PHP-FPM listen on a TCP port?

For this layout, use a local Unix socket such as /run/php/php8.3-site1.sock. Do not bind FPM to a publicly reachable address; the web server can connect locally without exposing the service to the network.

Why does each virtual host need its own socket?

The socket is the explicit link between a domain and its PHP-FPM pool. A one-to-one domain, document-root and socket mapping prevents site1 requests from being sent to site2’s workers.

Do disk quotas limit CPU or memory?

No. User and group quotas count filesystem blocks and inodes. Use PHP-FPM settings such as pm.max_children, plus system monitoring, to control process consumption and investigate memory pressure.

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

Why is my quota not counting uploaded files?

Quotas charge files to their owning user. If uploads or PHP-generated files are created by another account, usage is recorded against that account instead of the site’s user. Make the site account the writer or account for the ownership deliberately.

Are usrquota and grpquota valid on every filesystem?

No. The ext4 example uses those options, while XFS uses names such as uquota/usrquota, gquota/grpquota and project-quota variants. Identify the filesystem with findmnt and follow its distribution-specific procedure.

What is the difference between a soft and hard quota limit?

A soft limit can allow a grace period or warning behavior after it is crossed. A hard limit is the enforced ceiling. Confirm the units and argument order for your installed setquota version before applying limits.

What should I check after adding a new site?

Validate the FPM pool and web-server configuration, reload services, confirm the expected socket exists, request the domain, verify the PHP process account, inspect logs, apply the user quota and confirm usage with repquota.

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

The Bottom Line

To host multiple websites safely on one Linux VPS, give every site its own Linux user, document root, PHP-FPM pool and Unix socket. Point each virtual host to the matching socket, enforce user or group quotas on the filesystem that stores the sites, and size PHP workers for the VPS memory. Validate ext4 or XFS quota syntax on the exact system you run, because pools improve isolation but do not replace operating-system permissions or create a complete sandbox.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.