Make a Website

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.

A self-hosted NextCloud file sharing site open in a browser

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.

StorageTypical VPS costSuits
50 GB$5–6 / monthYourself, or a family
200 GB$10–15 / monthA small team
1 TB$25–40 / monthA small business
1 TB (storage VPS)$10–15 / monthSame, 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?

SoftwareBest forCost
NextCloudMost people. Files, sharing, calendar, chat, calls.Free
ownCloudFiles only, lighter than NextCloudFree
SeafileSpeed with very large numbers of filesFree
FileRunSimple sharing, runs on shared hostingPaid

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_filesize and post_max_size raised to at least 512M, or nobody can upload a video.
  • PHP memory_limit of 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:

  1. Create a database, for example nextcloud
  2. Create a user with a long random password
  3. 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.

  1. 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.
  2. Add memory caching. Install APCu or Redis. Without it every page load is noticeably slow.
  3. Set the correct region and default phone region, or share links generate with wrong data.
  4. 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.

  1. Force HTTPS. Sync clients will not connect without it anyway.
  2. Turn on two-factor authentication for admin accounts at minimum.
  3. Set up automated backups — the database and the data folder. A backup of only one is not a backup.
  4. Apply updates. NextCloud tells you when one is available. An unpatched public file server is a target.
  5. 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.

Questions people ask

Is it cheaper to self-host file storage than to use Google Drive?
Usually not for one person. Google One gives 2 TB for about $10 a month, while a 1 TB VPS costs $25 to $40. Self-hosting wins when many people share one pool — fifty staff on one NextCloud server costs the same as one user, where a hosted service would charge per seat.
Can I run NextCloud on shared hosting?
It will install but you will regret it. Shared hosting caps PHP memory, blocks the cron jobs NextCloud needs for background work, and limits upload size. Use a VPS with at least 2 GB of RAM.
How much RAM does NextCloud need?
Two gigabytes is the practical minimum. One gigabyte installs and then crawls. If you add Talk for video calls, or document editing, plan on 4 GB.
Why is my NextCloud so slow?
Almost always a missing memory cache. Install Redis or APCu and configure it in config.php. This single change makes more difference than anything else. After that, check that background jobs run through cron rather than AJAX.
Why do large file uploads keep failing?
PHP limits. Raise upload_max_filesize, post_max_size and max_execution_time together — changing only one will not fix it. In cPanel these are under Select PHP Version then Options.
What is the difference between NextCloud and ownCloud?
NextCloud is a fork of ownCloud and now has the larger community, more apps and features like Talk built in. ownCloud is lighter if you only want file sync. For most people starting today, NextCloud is the safer choice.
Can people upload files without an account?
Yes. Create a folder, share it as a link, and enable Allow upload and editing. Always add a password and an expiry date, otherwise the link can be passed around indefinitely.
Is a self-hosted file sharing site secure?
It can be safer than a public service because nobody else scans your files, but only if you maintain it. Force HTTPS, enable two-factor authentication, apply updates, set per-user quotas, and back up both the database and the data folder.
Should I allow public sign-ups on my file sharing site?
Think very carefully. Open storage attracts piracy and malware hosting within weeks, and it is your server, your IP address and your legal exposure. Most people should keep registration invite-only.
Does NextCloud support video calls?
Yes, through the Talk app. One-to-one calls work as soon as you install it. Group calls need a separate high-performance back end and noticeably more server resources.
How do I make a file storage or file hosting website?
The same way as a file sharing site, because NextCloud does both: get hosting with enough disk space, create a database, upload NextCloud and run the installer, then change the settings in Step 6. Disk space is the main cost, so read the cost section before you choose a plan.

Written by Habib Baloch

I build Android apps, websites and Ubuntu servers, and write down exactly how I did it.

Ask me about this guide →