NExtcloud and local fileserver in co-operation?

I have no support/technical question and have seen the support category. (Be aware that direct support questions will be deleted.)

on

Which general topic do you have

We have a local file server at the moment. We are looking into installing a Ubuntu server with Nextcloud instead. We would like to be able to use our File explorer to open files when at office and use Nextcloud to get acces when we are on the move. Is it possible to use our Nextcloud file area as our File server? Would it pose and problems?
Has anyone had the same thoughts and if so, how did you go about it?

Hello,

You provide so little information about your use case that it is nearly impossible to assist you.

What is that?

Yes, you can store files in Nextcloud pretty well.

As @rakekniven wrote, its hard to know what you want and impossible to know what you currently use. You don’t even told us what Operating Systems your Clients do use.

But there is a quite simply way to use a Nextcloud Server as a File Server → WebDAV.

Hi and thanks for the quick replies! Sorry for being vague in the first post.

To clarify our setup and needs:

  1. Client OS: We are primarily using [Windows 10/11]. When I said “File explorer”, I meant accessing the files directly via Windows Explorer (or Finder on macOS), just like a mapped network drive (e.g., Z: drive).

  2. Current Situation: We currently use a standard local file server (SMB).

  3. The Goal: We want to migrate to Nextcloud on Ubuntu. However, we have too much data to sync everything to every laptop. We want the “look and feel” of a direct file server connection when we are at the office, but the flexibility to access files remotely.

@adelaar mentioned WebDAV. Is mounting Nextcloud via WebDAV the recommended way for daily heavy usage in an office LAN, or would the Nextcloud Desktop Client with “Virtual Files” be a better solution for us?

We are mainly concerned that WebDAV might be slower than our current SMB setup, so we are looking for best practices on how to replace a traditional File Server with Nextcloud.

Thanks again!

When i mentioned WebDAV i did not know you wanna use Nextcloud in an Office surroundung. WebDAV ist not good for that type of use, since the server can’t lock files.

EDIT: it works as it should be. Go to @ernolf’s hint using Temporary files lock app (files_lock). That is the solution to make Nextcloud a full FIle Server

Hi @Wolverine

Give it a try and gather experiences. Feedback would be nice.

You can use both simultaneous, the official client and some mapped drives by NcDavTray for certain folders.

h.t.h.


ernolf

Besides of ernolf’s implementation, if you use the client, the virtual file system would be the way that you don’t have to store all the files on each client.

If you want a look and feel of Nextcloud, there are a few providers giving smaller demo accounts for free: Sign up for a free Nextcloud account
Or you just go ahead and install Nextcloud on your server


Thats not true. WebDAV supports File Locking and nextcloud fully supports RFC 4918

It is the Windows’ WebDAV WebClient which doesn’t really handle WebDAV locking itself, but when you open a document in Office from a mapped WebDAV drive, Office opens its own WebDAV connection to the server and does proper locking on the application level.

How locking works with WebDAV, Windows WebClient and Office

There are actually two different layers involved when you open a file from a mapped WebDAV drive:

  1. The Windows WebDAV WebClient (the thing that maps the drive letter like NcDavTray)
  2. The application itself (e.g. Microsoft Office, OnlyOffice, 
)

1. Windows WebClient by itself

The Windows WebDAV WebClient is basically just a redirector that exposes a WebDAV share as a drive letter (X:\ etc.) and NcDavTray makes it particularly convenient to manage and install these drives.

On its own, the WebClient (the DavClient part under the microsoft hood):

  • does not handle proper WebDAV locking (it doesn’t send LOCK/UNLOCK in the way a full WebDAV client would),
  • just gives applications a file handle as if it were a normal network drive.

If an application only uses this layer (for example a simple text editor), then there is effectively no WebDAV-based locking, and two users can overwrite each other’s changes, the last person who saves the file “wins”.

2. What Office does on top of that

Office behaves differently:

  • When you open an Office document (e.g. .docx, .xlsx) from a mapped WebDAV drive,

  • Office does not just keep using the file handle from the WebClient,

  • instead, Office detects that the file comes from a WebDAV location and then opens its own WebDAV session directly to the server, requesting credentials (dedicated App-Password).

  • Over this direct WebDAV connection, Office:

    • talks to the server with proper WebDAV requests,
    • creates and maintains a lock for the document,
    • and uses its own mechanisms for conflict handling / collaboration.

So in practice:

The Windows WebDAV WebClient itself does not provide reliable locking,
but Office “takes over” the file via its own WebDAV client,
and that part does implement locking correctly.

That’s why:

  • If two users open the same document in Office via the mapped WebDAV drive,
    they will still see proper “file is locked by 
” / read-only messages.
  • But if they open the same file in a simple editor that does not implement its own WebDAV logic, there is no locking protection.

h.t.h.


ernolf

1 Like

A post was split to a new topic: File locking on webdav mounts on Linux

2 posts were merged into an existing topic: File locking on webdav mounts on Linux

Thanks for the suggestion! I have actually installed a test instance now. I haven’t gotten around to properly testing the ‘file server’ aspect of it yet (connecting clients and checking performance), but it’s next on my to-do list :slightly_smiling_face:

Hi @ernolf,

Thank you so much for taking the time to write such a comprehensive and technical answer! That really clears up how the locking mechanism works under the hood. I wasn’t aware that Office actually bypasses the Windows WebClient to establish its own connection and handle the locking itself—that is a crucial detail for us.

Given this information, and our need for a reliable “file server” experience: Do you personally recommend sticking to this mapped WebDAV drive approach, or would we be better off using the Nextcloud Desktop Client with “Virtual Files”?

I’m curious if the Desktop Client handles locking (especially for non-Office files) more reliably than the standard Windows WebClient does?

Thanks again for sharing your expertise, it’s highly appreciated!

Hi @Wolverine,

OK, so with the Temporary files lock app (files_lock ) installed, you have the option to lock any file in the context menu of the official Nextcloud Desktop Client (whether synchronized or virtual). This lock prevents other users from editing that file. You can still edit the same file in different clients as long as you are the same Nextcloud user. Therefore, you should not use shared accounts!
Automatic file locking by Office applications (Microsoft365, Open-/Libre-Office, Collabora etc.) does not work in the official Nextcloud Desktop App. These locks work better on an NcDavTray network drive. Therefore, there is no option to lock individual files in the context menu of files on NcDavTray network drives. I am currently working on this feature, so it is possible that it will be improved in the future.

I recommend using NcDavTray and the official Desktop Client in parallel.

Both offer different advantages.


ernolf

1 Like

Thanks @ernolf!

That is a brilliant clarification. As a Graphic Designer working with heavy files (Adobe CC etc.), the automatic locking in Office apps doesn’t help me much with .indd or .psd files. So, the manual lock feature in the Desktop Client sounds absolutely vital for our creative workflow, while the WebDAV/NcDavTray route seems superior for our administrative/Office workflows.

Using them in parallel sounds like the way to go to get the "best of both worlds. Thanks!

1 Like

We use File Explorer, Nautilus and Finder to access files when at home and on the go via the Desktop Client. There has been no need so far to use different clients. When I need to work on a file for a long time, I pause sync and then resume sync when the work is finished. There is also a helpful option to sync only specific folders instead of syncing everything.

2 Likes

You can use Nextcloud exactly as you want to.

I run Nextcloud (on Linux) with a Windows file server (in domain). You can connect with smbclient (part of Nextcloud) Windows Shares (or others) and map them into the file hierarchy of Nextcloud.

E.g. You have a Windows share \\WinSrv\Books and can map it as Books (or what ever name you like) into Nextcloud. On Windows side it behaves like a normal share. On Nextcloud it behaves similar to a Nextcloud directory. Not sure if it still has some limitation compared to an in-nextcloud-directory.

Yo can configure that in Administraton settings - External Storage for all users or by user (SMB/CIFS).


The configuration above is a global one (but “only” an example. I use DFS). I used Login and password for authentication because when I setup my NC there was nothing else which worked. Now there are other options.
It will than look like this:

While Backups is a normal Nextcloud directory.

This feature was one of the reasons I use Nextcloud.

1 Like