NVMe VPS in Sweden for your own cloud: Nextcloud without the lag
People often come to Sweden for a server to hold personal and work files: their own Nextcloud for a family or a small team, shared documents, photo sync from phones. The country is in the EU, has clear rules about data and cheap electricity. The main question for this job is simple: if there will be hundreds of gigabytes of files and the NVMe disks on the plans are small, how do you fit one into the other without losing speed?
What in Nextcloud slows down because of the disk
The files themselves hardly need a fast disk. A film or an archive is read in one go from start to finish, and an ordinary HDD handles that fine. Other things are what drag:
- The database. Nextcloud keeps a record of every file in a table, and during sync the clients on phones and laptops keep asking what has changed. With a hundred thousand files those are heavy queries, and they are limited by the disk under the database.
- Previews. The gallery builds thumbnails of every photo in several sizes. That means millions of small files, and opening a folder with a year of photos means thousands of random reads.
- Locks and sessions. Without Redis, Nextcloud keeps file locks in the database, and every upload adds extra writes.
So the system, the database, the previews and the cache should live on NVMe. The files themselves can go on a cheaper disk.
How to split fast storage from big storage
Here is a layout that works on most Swedish plans. Take an NVMe VPS with a 40 to 80 GB disk and at least 2 GB of memory. Install Nextcloud, the database and Redis on it. For the files, attach separate storage: an extra disk from the same provider if it sells large HDD volumes, or S3 object storage, which Nextcloud can use as primary storage. The thumbnails stay on the fast disk, so the gallery opens at once even though the originals live on the slow one.
If the provider does not sell extra disks, look at plans with a large HDD on VPS for file storage: you can run the cloud on the NVMe server and keep the files on a neighbouring one, mounted over the network inside the same data centre. Setting up the cloud itself is covered on VPS for Nextcloud.
Three settings that spare the disk
- Enable Redis for caching and file locking: it removes most of the small writes to the database.
- Limit preview sizes in
config.phpwithpreview_max_xandpreview_max_y, for example to 2048 pixels. By default Nextcloud may create huge thumbnails that take almost as much space as the originals. - Run background jobs from the system cron, not via AJAX. Then emptying the trash and cleaning up old versions and previews happens on schedule and does not get in the users' way.
After the first upload of a photo archive, check how much space the appdata_*/preview folder takes. If it is more than a tenth of the photos themselves, the previews are too large.
And do not forget the backup. Copying the files folder is not enough for Nextcloud: without the database it will not know whose files they are or where they belong. The right order is to turn on maintenance mode with occ maintenance:mode --on, dump the database, copy the config directory and the data, then turn maintenance mode off. On NVMe the database dump of a small team's cloud takes seconds, so users will barely notice the pause.
Stockholm and latency
Almost all Swedish servers are in Stockholm and its suburbs. From Helsinki or Oslo it is usually around 8 to 12 ms, from Amsterdam and Frankfurt about 20 to 25 ms, and from London about 30 to 35 ms. For a file cloud that is a good figure: sync runs in the background and the web interface opens quickly. Port speed affects how it feels more than latency does. If you upload a gigabyte of video from your phone every week, check that the plan's port is not capped at 100 Mbit/s. Locations in the capital are collected on VPS in Stockholm.
Whose data it is and how to pay
Swedish providers work under GDPR, and the supervisory authority is IMY. If the cloud is only for your family, these are your personal files and there are almost no formalities, because GDPR does not apply to purely household use. If it holds documents of employees or clients, you become the controller of that data. You then need a data processing agreement with the provider, a clear idea of who has access, and a way to delete a person's data when they ask. Large providers offer the agreement in the customer panel.
Prices in Sweden are often shown in kronor or euro, and VAT in the country is 25 %. Private customers in the EU pay it on top, EU businesses with a VAT ID get a reverse-charge invoice, and customers outside the EU are usually not charged it. Cards and PayPal are standard; the table shows the payment methods for each plan, and a general overview of the country is on VPS in Sweden.