summaryrefslogtreecommitdiff
path: root/source/_posts/accessing_nextcloud_with_webdav_on_arch.md
blob: cdd0d3ac97f33602c13ca9c5ef7dc74a33c4ba43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
extends: _layouts.post
section: content
title: Accessing Nextcloud With WebDAV on Arch
date: 2021-02-15
description: A guide to how I synchronise files to Nextcloud.
tags: [Arch, Nextcloud]
---

I have a Nextcloud instance and I want to mount it as a directory on my local machine. Since Nextcloud cloud supports the WebDAV protocol its possible to do this by installing davfs2 which can mount a WebDAV resource.

The first thing I had to do was install davfs2.

```shell
$ sudo pacman -S davfs2
```

Next I created the directory where Nextcloud would be mounted.

```shell
$ mkdir -p .local/share/nextcloud
```

I then needed to tell Arch how to mount Nextcloud by adding the below line to the */etc/fstab* file.

```shell
https://my-nextcloud-server.com/path /home/david/.local/share/nextcloud davfs rw,user,uid=david,noauto 0 0
```

Since access to Nextcloud is controlled by a username and password these where added to the *~/.davfs2* file.

```shell
https://my-nextcloud-server.com/path username password
```

I made sure this file had the correct permissions to ensure security.

```shell
$ chmod 600 ~/.davfs2/secrets
```

Now I can mount Nextcloud and access my files just like any others.

```shell
$ mount .local/share/nextcloud
```