How to Make a File Sharing Website Like Google Drive
Run your own Google Drive with NextCloud. What server you actually need, what storage really costs, how to install it, and how to keep other people files safe.
You can run your own Google Drive. The software is free, it takes an afternoon, and after that your files sit on a server you control instead of someone else's.
The part most guides skip is the part that decides whether this actually works: storage costs money, and file sharing eats storage fast. We will deal with that honestly before touching any software.
What this will really cost
The software is free. Storage is not. This is the whole decision.
| Storage | Typical VPS cost | Suits |
|---|---|---|
| 50 GB | $5–6 / month | Yourself, or a family |
| 200 GB | $10–15 / month | A small team |
| 1 TB | $25–40 / month | A small business |
| 1 TB (storage VPS) | $10–15 / month | Same, on slower disks |
The honest comparison: Google One gives you 2 TB for about $10 a month. Self-hosting is rarely cheaper at small sizes. You do it for control — your data, your rules, no scanning, no account suspension — not to save money.
Where it does win: many users sharing one pool. Fifty staff on Google Workspace costs hundreds a month. Fifty staff on one NextCloud server costs the same as one.
Which software should you use?
| Software | Best for | Cost |
|---|---|---|
| NextCloud | Most people. Files, sharing, calendar, chat, calls. | Free |
| ownCloud | Files only, lighter than NextCloud | Free |
| Seafile | Speed with very large numbers of files | Free |
| FileRun | Simple sharing, runs on shared hosting | Paid |
We use NextCloud here. It has mobile apps, desktop sync, link sharing with passwords and expiry dates, and it is the one with the largest community when something breaks.
What your server actually needs
This is where most installs fail. NextCloud is not a small PHP script.
- 2 GB RAM minimum. 1 GB will install and then crawl.
- PHP 8.1 or newer, with these extensions:
gd,curl,zip,intl,mbstring,xml,bcmath,gmp,imagick. - MySQL 8 or MariaDB 10.5+
upload_max_filesizeandpost_max_sizeraised to at least 512M, or nobody can upload a video.- PHP
memory_limitof 512M
Can I use shared hosting?
Technically sometimes. Practically, no. Shared hosting limits PHP memory, blocks the background jobs NextCloud needs, and caps upload size. It will install and then frustrate you for weeks.
Use a VPS. Installing NextCloud on Ubuntu with Apache2 covers the clean way. The steps below are the cPanel route, for people who already have a VPS with a panel on it.
Step 1: Decide who this is for
Answer this before you install anything, because it changes the server you buy:
- Just you and family? 50 GB is plenty. Smallest VPS.
- A team or office? Work out average storage per person and multiply. Then double it — people always store more than they say.
- Public sign-ups? Think hard. Open storage gets abused for piracy and malware within weeks, and it is your server and your legal problem.
Step 2: Domain and hosting
Get a domain and point it at your VPS. Then get an SSL certificate — non-negotiable, because desktop and mobile sync clients refuse to connect over plain HTTP.
See how to install a free SSL certificate on Ubuntu.
Step 3: Create the database
In cPanel, open MySQL Database Wizard:
- Create a database, for example
nextcloud - Create a user with a long random password
- Grant that user All Privileges on the database
Write down all three. cPanel prefixes them with your account name, so the real name is youruser_nextcloud. Forgetting the prefix is the single most common install failure.
Step 4: Upload NextCloud
Download the latest release from nextcloud.com/install — choose the web installer or the full zip.
In File Manager, go to public_html, upload the zip, then click Extract. Extracting on the server takes seconds; uploading thousands of loose files takes hours.
NextCloud extracts into a nextcloud folder. If you want it at your main domain rather than yoursite.com/nextcloud, move everything up one level into public_html.
Step 5: Run the installer
Open your domain. The setup page asks for four things:
- Admin username and password — not "admin", and use a long password
- Data folder — leave the default unless you know why you are changing it
- Database details — from Step 3, with the cPanel prefix
- Database host —
localhost
Installation takes a few minutes. Do not refresh the page while it runs.
Step 6: The settings everyone forgets
NextCloud works after install but performs badly until you do these four things. Go to Administration settings → Overview, which lists the warnings.
- Set up background jobs with cron. The default AJAX method only runs when someone has the page open, so cleanup and sharing jobs silently never happen. Add a cron entry every 5 minutes.
- Add memory caching. Install APCu or Redis. Without it every page load is noticeably slow.
- Set the correct region and default phone region, or share links generate with wrong data.
- Raise the upload limit in Select PHP Version → Options. Default 2 MB means no photos, no videos, nothing useful.
What you get
- Upload, organise and share files and folders
- Share links with a password and an expiry date
- Desktop sync for Windows, Mac and Linux
- Mobile apps with automatic photo upload
- File versions and a recycle bin
- Calendar, contacts and notes
- Collaborative document editing through an add-on
Audio and video calls
NextCloud Talk adds chat and calls. Install it from the Apps page.
Calls between two people work straight away. For group calls you need a separate high-performance back end, which needs its own server resources. There is a full walkthrough in how to make a voice and video calling website with NextCloud.
Security: you are holding other people files now
This changes your responsibilities. Do all five.
- Force HTTPS. Sync clients will not connect without it anyway.
- Turn on two-factor authentication for admin accounts at minimum.
- Set up automated backups — the database and the data folder. A backup of only one is not a backup.
- Apply updates. NextCloud tells you when one is available. An unpatched public file server is a target.
- Set quotas per user so one person cannot fill the disk and take the service down for everyone.
Common problems
"Internal Server Error" after install
Almost always a missing PHP extension. Check the NextCloud log at data/nextcloud.log, or the server error log. Install whatever it names and restart PHP.
Large uploads fail at the same size every time
PHP limits. Raise upload_max_filesize, post_max_size and max_execution_time. All three matter — raising only one will not help.
Everything is slow
Almost certainly no memory cache. Install Redis or APCu. This one change usually makes the biggest difference of anything on this page.
Sync client says "connection refused"
Either SSL is missing or the certificate is self-signed. Sync clients are stricter than browsers and will refuse where a browser only warns.
Disk fills up unexpectedly
Deleted files sit in the trash and old file versions are kept. Set retention limits in the admin settings, otherwise storage grows quietly forever.
Where to go next
Once files work, the usual additions are Talk for chat and calls, Collabora or OnlyOffice for editing documents in the browser, and a second server holding backups.
If you would rather not run a server at all, a simple PHP upload-and-share script on shared hosting will handle basic file sharing — far less capable, but also far less to maintain.