WEBVTT Kind: captions Language: en 00:00:00.800 --> 00:00:08.560 Hello fellow Hyperspace travelers. Today I'd like to 00:00:08.560 --> 00:00:17.320 introduce you to a simple server for setting up a cloud with WebDAV. The solution is called SFTPGo. The name 00:00:17.320 --> 00:00:24.640 suggests it; the system is primarily designed for use with SFTP. 00:00:24.640 --> 00:00:32.320 SFTP is an encrypted file transfer protocol, but SFTPGo also supports 00:00:32.320 --> 00:00:39.760 WebDAV. To set it up, simply go to the website SFTPGo.com and select 00:00:39.760 --> 00:00:45.000 the Docs section in the menu for the instructions. There you'll find a 'Getting Started Guide 00:00:48.320 --> 00:00:45.000 ,' which we'll be using today. I'll click on the 'Installation' section and 00:00:53.440 --> 00:00:45.000 find the installation instructions for the various operating systems, including 00:01:00.200 --> 00:00:45.000 Ubuntu and Debian. We're using Debian as the base, Debian Stable. These 00:01:06.200 --> 00:00:45.000 versions are currently supported. The first thing we need to do is download the GPG key 00:01:12.640 --> 00:00:45.000 using curl. So, if curl isn't already installed, we should 00:01:17.920 --> 00:00:45.000 do that first. 'sudo apt install curl'. I'm even already running as root here. You can then 00:01:24.640 --> 00:00:45.000 set it up accordingly. I've now installed curl, and can now 00:01:30.320 --> 00:00:45.000 start setting up the key here. He also wants gnupg, 00:01:38.160 --> 00:00:45.000 so we'll install that for him, and then we download this GPG key with curl 00:01:43.800 --> 00:00:45.000 and save it in text format in the file /usr/share/keyrings/sftpgo-archive-keyring.gpg. 00:01:54.200 --> 00:00:45.000 He's done that now. Next, we can create this sources.list. 00:01:59.120 --> 00:00:45.000 The repo for the project is stored in the sources.list, and a codename is used here. We can 00:02:05.000 --> 00:00:45.000 read it out here: 'CODENAME=lsb_release -c -s', and we can then run it manually, 00:02:14.760 --> 00:00:45.000 and then we immediately see what's written to this environment variable. 00:02:19.960 --> 00:00:45.000 It writes 'bookworm' here. This is the current Debian stable release. This can 00:02:24.760 --> 00:00:45.000 be different depending on the distribution used. Then we run this command, 00:02:30.600 --> 00:00:45.000 which actually creates this sources.list with 'sudo tee', which 00:02:36.440 --> 00:00:45.000 we need, of course. I'll do that now, and then this variable codename will be used, 00:02:43.360 --> 00:00:45.000 which you then write into this file. We can take a look at it: 00:02:48.640 --> 00:00:45.000 'cat /etc/apt/sources.list.d/sftpgo.list' and we can see that it has actually 00:02:58.960 --> 00:00:45.000 already written bookworm into it. So we've now prepared this sources.list and 00:03:04.560 --> 00:00:45.000 can now update our system, i.e., the package lists, first. 00:03:09.720 --> 00:00:45.000 We do this as usual with 'sudo apt update', and then we can 00:03:14.640 --> 00:00:45.000 install the actual application. I'll do that here. As always, 00:03:22.560 --> 00:00:45.000 if you want to install the whole thing in self-hosted mode at home, you need 00:03:28.080 --> 00:00:45.000 to prepare your router accordingly. At least for setting up SSL, you need to forward port 80, and 00:03:35.840 --> 00:00:45.000 then a corresponding port for using HTTPS and WebDAV. We'll look 00:03:42.400 --> 00:00:45.000 at that in more detail in a moment. We've already installed the software here, and we 00:03:47.200 --> 00:00:45.000 can take a look at it right away. It's 00:03:52.560 --> 00:00:45.000 already set up the software in the background, and next in the configuration it'll tell me 00:03:58.480 --> 00:00:45.000 how to actually call it up. We're still in the Getting Started 00:04:04.440 --> 00:00:45.000 area. The very first thing we do is say 'sudo netstat -antp' and look at 00:04:12.560 --> 00:00:45.000 what it actually has running here. Something is already running, and 00:04:17.600 --> 00:00:45.000 SFTPGo is currently running on port 8080, and there's also a service running here, and it's responsible for SCP. I'm 00:04:26.640 --> 00:00:45.000 now going to go to http://localhost:8080 and I'm already on the 00:04:34.960 --> 00:00:45.000 SFTPGo administration frontend. The first thing I can do here is create an admin user. I'll call it 00:04:40.480 --> 00:00:45.000 tux and give it a corresponding password. You can recreate the whole thing at home, as always 00:04:47.240 --> 00:00:45.000 . I recommend, of course, that you use the mini version of my Linux distribution Tuxwiz 00:04:52.920 --> 00:00:45.000 , as it's very well suited for setting up your home server. 00:04:58.880 --> 00:00:45.000 So, we're now in the admin frontend of this SFTPGo installation and can 00:05:06.320 --> 00:00:45.000 Get started right away. You can 00:05:11.600 --> 00:00:45.000 configure two-factor authentication here if you'd like. First, we've only installed SFTPGo. 00:05:18.440 --> 00:00:45.000 It's not accessible from the outside at the moment, and we want to 00:05:23.040 --> 00:00:45.000 configure the SSL configuration first. For that, there's a 00:05:30.440 --> 00:00:45.000 link here where you can request an SSL certificate. You'll need a 00:05:37.880 --> 00:00:45.000 domain, of course. In my case, I have a DynDNS domain called 00:05:41.800 --> 00:00:45.000 tuxwiz.mooo.com, which points directly to my home server, 00:05:49.440 --> 00:00:45.000 i.e., my router. Here, I'll enter an email address for the certificate, 00:05:54.120 --> 00:00:45.000 astronaut@spacefun.ch, and this port, which must be open on the router. Here, I can 00:06:03.360 --> 00:00:45.000 specify later what the certificate should actually be used for, and I'll 00:06:07.600 --> 00:00:45.000 just say HTTP, FTP, and WebDAV. For SFTPGo, we only want 00:06:14.640 --> 00:00:45.000 to use the WebDAV installation. You can also use the system just as well for SFTP, 00:06:21.160 --> 00:00:45.000 because that's what it's designed for. I'll say 'Save' here, and then we'll see 00:06:25.960 --> 00:00:45.000 if it can already retrieve this certificate in the background. If it can't, 00:06:31.520 --> 00:00:45.000 then your domain might not be set up correctly. It really needs 00:06:35.360 --> 00:00:45.000 to point to your router's IP address. Here, it's already successfully 00:06:41.400 --> 00:00:45.000 done that in the background. As usual, I've 00:06:46.680 --> 00:00:45.000 created a little cheat sheet for this installation, and I'm listing all the most important commands there 00:06:52.120 --> 00:00:45.000 . So, we've already installed SFTPGo and can now 00:06:56.720 --> 00:00:45.000 begin with the actual configuration. The first thing we want to do is 00:07:02.920 --> 00:00:45.000 enable the SSL protocol for WebDAV. We want 00:07:10.080 --> 00:00:45.000 to use encrypted WebDAV, and you can see in the status area of ​​the Server Manager that 00:07:17.400 --> 00:00:45.000 WebDAV is currently disabled. And if you had enabled it, only HTTP 00:07:23.760 --> 00:00:45.000 would actually be used at the moment. Now we'll take a look at the whole thing and to do so we'll edit 00:07:28.840 --> 00:00:45.000 this file /etc/sftpgo/env.d/webdavd.env, because you can easily 00:07:35.520 --> 00:00:45.000 make configuration settings there using environment variables. We'll now go to a file webdavd.env 00:07:42.000 --> 00:00:45.000 and then write the relevant configuration settings following the instructions. 00:07:47.920 --> 00:00:45.000 Paste it in here and this is where the certificate, for example, is specified. You'll 00:07:54.440 --> 00:00:45.000 obviously have to adapt the name to your domain, because the certificate is naturally 00:07:59.560 --> 00:00:45.000 set up in your domain's name. I'll now say 'Ctrl+O', Enter, 'Ctrl+X', and finish. We can also 00:08:05.080 --> 00:00:45.000 take another look at it: 'ls- al /var/lib/sftpgo/certs/' and your certificate will be there. We have to 00:08:12.600 --> 00:00:45.000 do this with sudo, because my normal user has no rights there. As you can see, 00:08:17.200 --> 00:00:45.000 only the SFTPGo user has rights and, of course, root. So we've now set up WebDAV and 00:08:24.680 --> 00:00:45.000 encrypted it accordingly. And now, first of all, we can restart the service, and 00:08:30.040 --> 00:00:45.000 we'll do that first. We could then look in the backend to see what happened 00:08:35.760 --> 00:00:45.000 . Let's look again at 'System'—ah, of course, this also has to 00:08:40.320 --> 00:00:45.000 be done as root again. 'sudo service sftpgo restart'. I'll write that 00:08:45.560 --> 00:00:45.000 down here for you, so you'll have it clean. The service has already restarted in the background, and 00:08:50.720 --> 00:00:45.000 now we should be able to see what happened directly in the Status area. It already has 00:08:56.480 --> 00:00:45.000 HTTPS active on port 8080. We'll want to change that later, of course; we want 00:09:02.320 --> 00:00:45.000 to choose a separate port for it. But for now, I'm accessing port 8080. That's 00:09:08.160 --> 00:00:45.000 not the correct domain, of course. I'll log in here and can now 00:09:14.600 --> 00:00:45.000 access the system again with my password. However, it's not in admin mode here, but 00:09:21.680 --> 00:00:45.000 in user mode. I have to click 'Go to Web Admin' here and only then can I 00:09:26.120 --> 00:00:45.000 log in as an admin. This is an admin user who doesn't have a regular user account, and now we can 00:09:31.200 --> 00:00:45.000 check again in the Server Manager under Status to see if WebDAV is now active. 00:09:36.680 --> 00:00:45.000 is active and it uses the HTTPS protocol here and not HTTP, which is very important, 00:09:42.040 --> 00:00:45.000 and it has port 10443. We now want 00:09:48.320 --> 00:00:45.000 to run the web frontend on a different port, with HTTPS, no longer on port 8080. And we'll also 00:09:52.920 --> 00:00:45.000 make a small configuration change that looks very similar to what we already have, so 'sudo 00:09:59.400 --> 00:00:45.000 nano /etc/sftpgo/env.d/httpd.env' and I'll paste the content in here. And then 00:10:07.560 --> 00:00:45.000 the certificate obviously needs to be adjusted again, so the name tuxwiz.mooo.com here. 00:10:12.960 --> 00:00:45.000 You have to adjust this to your DynDNS domain or your domain. Here you can also see the port 00:10:18.640 --> 00:00:45.000 I'd like to use. That would be 9443. But I could also just choose port 443. 00:10:23.640 --> 00:00:45.000 I'll do that now and say 'Ctrl+O', Enter, 'Ctrl+X', and finish. Now 00:10:29.880 --> 00:00:45.000 I can restart the service again with 'sudo service sftpgo restart' and now 00:10:35.000 --> 00:00:45.000 the service should actually be accessible via port 443. Let's take a look at 00:10:40.600 --> 00:00:45.000 tuxwiz.mooo.com and I'll also put an https in front of it so that it goes 00:10:49.400 --> 00:00:45.000 there encrypted. And now I'm actually on my 00:10:53.680 --> 00:00:45.000 SFTPGo instance over the internet and can log in again as my admin using 'Go to Web Admin', 00:11:00.440 --> 00:00:45.000 say here, enter my password and I'm in here now. The very first thing 00:11:06.560 --> 00:00:45.000 I would do is create a new user. I can do that here in the Users area, 00:11:09.800 --> 00:00:45.000 'Add' and now I say username Astronaut, for example, and under Password I 00:11:15.800 --> 00:00:45.000 enter a password here and with that I can get started. Here I could 00:11:21.680 --> 00:00:45.000 also store a public key. I would then have to do that here, 00:11:27.040 --> 00:00:45.000 and now I'll just say Save and then the defaults will be used. Now 00:11:32.120 --> 00:00:45.000 I'm not going to log in to the backend, but simply go to tuxwiz.mooo.com. Here I can see 00:11:37.920 --> 00:00:45.000 that I'm in the frontend, so I log in with Astronaut and enter my password here 00:11:45.280 --> 00:00:45.000 . I'm now actually in the web frontend, from the client's perspective, i.e. from 00:11:51.000 --> 00:00:45.000 the user's perspective, and I can actually upload individual files. I can now simply 00:11:56.600 --> 00:00:45.000 drag and drop and upload this sftpgo.txt. I say Save and then the whole thing is 00:12:02.600 --> 00:00:45.000 visible in the WebGUI. I could also share it, like on a Nextcloud, for example. I could 00:12:08.240 --> 00:00:45.000 create a share here, a folder, for example, 'shared', 'New folder', now say 'shared', 00:12:15.920 --> 00:00:45.000 Enter and I could now create a new share here. 'Add share', then 00:12:22.840 --> 00:00:45.000 I could say, for example, how the other person can access it. Then I say a password/secret here 00:12:30.480 --> 00:00:45.000 and then say, for example, I enter a password and I could also 00:12:36.200 --> 00:00:45.000 define an expiration date. Then I say Save here and the share is created. And here 00:12:40.840 --> 00:00:45.000 I can then simply copy a single directory link, for example, and then I can 00:12:47.560 --> 00:00:45.000 give it to the person I'm talking to, and they can then easily access these files using the password. 00:12:52.760 --> 00:00:45.000 This way I can easily exchange data with friends and acquaintances. I could 00:12:57.800 --> 00:00:45.000 also create a shared folder here for all users who work on the SFTPGo instance; 00:13:04.960 --> 00:00:45.000 that's possible too. And then I can even define who can do what, 00:13:08.960 --> 00:00:45.000 i.e. whether they can read/write or only read—all of this is possible. But now we 00:13:13.920 --> 00:00:45.000 obviously want to access it via WebDAV, and there are a few things to consider with WebDAV. 00:13:19.080 --> 00:00:45.000 If it isn't already installed, you should definitely install davfs2. It's already 00:13:24.240 --> 00:00:45.000 there: 'sudo apt install davfs2'—that's the package. And then you can access this share directly, 00:13:31.040 --> 00:00:45.000 for example, using the Thunar file manager. You then have to access it 00:13:37.800 --> 00:00:45.000 via WebDAV using the port that you specified in the configuration earlier 00:13:43.200 --> 00:00:45.000 . We can take another look at that, like, 'netstat -antp'. I could also 00:13:51.760 --> 00:00:45.000 type '|grep sftpgo' here, and then I'll only see the services that are shared here via SFTPGo. 00:13:57.960 --> 00:00:45.000 And now I see this port that I mentioned earlier for WebDAV, 10443. And 00:14:03.600 --> 00:00:45.000 Now we can try to see if we can actually access this server via WebDAV 00:14:09.000 --> 00:00:45.000 . To do this, I could simply enter the URL 00:14:15.280 --> 00:00:45.000 tuxwiz.mooo.com and then 00:14:20.920 --> 00:00:45.000 :10443 in the URL here in Thunar. It should actually go over the internet. That's why it can't access it yet 00:14:27.640 --> 00:00:45.000 , because it's not actually open on my router yet. So 00:14:33.800 --> 00:00:45.000 I would have to open port 10443 on my router as well, otherwise it 00:14:39.440 --> 00:00:45.000 won't work, of course. We are here now. Since we are now directly on the server, I could also 00:14:44.360 --> 00:00:45.000 access it directly via localhost. Of course, the certificate says it's incorrect, because that 00:14:49.040 --> 00:00:45.000 's tuxwiz.mooo.com. I'll say 'Yes' anyway, astronaut, I could 00:14:56.200 --> 00:00:45.000 enter the password here and could even save it here, in the password safe. Then I could access it directly 00:15:01.360 --> 00:00:45.000 , and here I can see my files, which I also saw in the web front end, 00:15:06.320 --> 00:00:45.000 very easily accessible. You have to keep in mind that if you use WebDAV under Windows, 00:15:11.160 --> 00:00:45.000 the registry is set so that the maximum file size is 50 MB by default. That 00:15:18.320 --> 00:00:45.000 's obviously very, very little. You would have to adjust it accordingly. 00:15:23.600 --> 00:00:45.000 I've put a link to how to do this in the cheat sheet below, and you can 00:15:29.120 --> 00:00:45.000 read it again in detail. As always, you can find the cheat sheet in our Telegram community. You can get 00:15:34.360 --> 00:00:45.000 there easily via www.spacefun.ch and then select the Telegram option, and then 00:15:42.360 --> 00:00:45.000 you're already with us. So if you have any questions about setting up the system, 00:15:48.400 --> 00:00:45.000 don't be shy. Come join our Telegram community. We'll be happy to help you, 00:15:53.920 --> 00:00:45.000 and then I'm quite sure you'll be able to do it yourself. I hope you have 00:15:59.080 --> 00:00:45.000 fun recreating this SFTPGo solution. I think it's a really great solution— 00:16:03.920 --> 00:00:45.000 very streamlined, easy to set up, and great to use. Have fun and see you soon. Bye.