1 00:00:00,020 --> 00:00:03,640 It's time for part two in our complete beginner's guide to self-hosting. 2 00:00:04,120 --> 00:00:05,820 My name's Alex and I'm from Tailscale. 3 00:00:06,420 --> 00:00:10,100 In part one, I showed you how to install Proxmox, a hypervisor OS, 4 00:00:10,560 --> 00:00:12,740 onto this little Dell small form factor PC. 5 00:00:13,400 --> 00:00:14,660 I'll put a link to that video up here. 6 00:00:15,180 --> 00:00:18,800 In today's video, though, I'm going to show you how to get started installing a bunch of applications. 7 00:00:19,480 --> 00:00:23,400 Image to replace Google Photos, Audio Bookshelf to replace Audible, 8 00:00:24,060 --> 00:00:26,799 and then Home Assistant to get started with self-hosted, 9 00:00:27,200 --> 00:00:29,740 privacy-respecting, open-source home automation. 10 00:00:29,820 --> 00:00:35,620 I'll also show you how to access all of those things from wherever you are in the world on your phone over 5G 11 00:00:36,140 --> 00:00:43,200 You can be on holiday on the other side of the world and still connect back to this little box running under your stairs over tail scale completely for free 12 00:00:43,920 --> 00:00:45,760 So that's what we're going to do in today's video 13 00:00:46,180 --> 00:00:50,980 We're going to show you how to install a bunch of applications and get started with self-hosting and tail scale 14 00:00:52,600 --> 00:00:55,860 Okay, so let's pick things up exactly where we left them a couple of weeks ago 15 00:00:56,500 --> 00:00:59,280 This is a completely fresh proxmox install 16 00:00:59,340 --> 00:01:05,300 I'm connected to the, essentially I'm using JetKVM here as if it's a keyboard, monitor and mouse 17 00:01:05,600 --> 00:01:10,179 physically plugged into the device to record the screen so I can show you on video. This is exactly 18 00:01:10,240 --> 00:01:14,520 the same as if you had literally those physical things on the table in front of you, except I can 19 00:01:14,580 --> 00:01:19,320 see it in a web browser. So you can see here, when we boot into Proxmox for the first time, 20 00:01:19,820 --> 00:01:26,460 we get a IP address. Now IP address, you can kind of think about a little bit analogous to like an 21 00:01:26,480 --> 00:01:29,420 an apartment building, for example, like the address of an apartment building. 22 00:01:30,020 --> 00:01:33,259 And then the port number, which here is denoted by 8006, 23 00:01:33,920 --> 00:01:36,040 that's the apartment within the building. 24 00:01:36,740 --> 00:01:40,660 So you've got the apartment building of 192.168.1.10, 25 00:01:41,120 --> 00:01:44,560 and then the apartment or the service that we want to access within that building 26 00:01:45,080 --> 00:01:46,760 running on port 8006. 27 00:01:47,380 --> 00:01:49,820 So what we do with that information is we take this string here 28 00:01:50,320 --> 00:01:52,100 and we type it into our web browser over here. 29 00:01:52,160 --> 00:02:00,039 So we do HTTPS colon slash slash 192.168.1.10 colon 8006. 30 00:02:00,620 --> 00:02:04,820 We'll probably get the scary, this is an HTTPS self-signed certificate, 31 00:02:05,020 --> 00:02:06,360 the world is about to end, error. 32 00:02:06,940 --> 00:02:07,980 Don't worry about that, it's fine. 33 00:02:07,990 --> 00:02:08,740 You can just click through. 34 00:02:09,139 --> 00:02:11,920 We're going to deal with how to get rid of that error in the next section, 35 00:02:12,130 --> 00:02:14,019 or this section technically I suppose, 36 00:02:14,720 --> 00:02:17,359 because what we're going to do first is installing TailScale. 37 00:02:17,400 --> 00:02:18,760 I've got like a little cheat sheet here, 38 00:02:18,820 --> 00:02:24,120 which I'll probably put this document into the GitHub repo. 39 00:02:24,920 --> 00:02:27,540 All of my videos have code snippets, 40 00:02:27,740 --> 00:02:29,040 well, most of them have code snippets, 41 00:02:29,520 --> 00:02:31,120 and like a running order of what's going on. 42 00:02:31,410 --> 00:02:33,160 So I'm going to put this script, this document, 43 00:02:33,520 --> 00:02:35,040 into the GitHub repo, 44 00:02:35,190 --> 00:02:36,920 which will be linked in the description down below. 45 00:02:37,360 --> 00:02:38,480 And as best as I can manage, 46 00:02:38,920 --> 00:02:40,440 I'm not going to edit each chapter, 47 00:02:40,820 --> 00:02:42,660 because there'll be chapters in the description. 48 00:02:42,760 --> 00:02:45,380 So you can skip to the part of the video that you want. 49 00:02:45,580 --> 00:02:46,100 So to start with, 50 00:02:46,360 --> 00:02:48,020 we're going to talk about installing TailScale 51 00:02:48,040 --> 00:02:49,600 and how to set up Tailscale SSH. 52 00:02:50,100 --> 00:02:54,660 We should probably talk about also setting up a TLS certificate using 53 00:02:54,660 --> 00:02:55,680 serve 54 00:02:56,080 --> 00:02:58,260 so that we don't have to worry about a reverse proxy. 55 00:02:58,820 --> 00:02:59,980 We'll come on to all that stuff later. 56 00:03:00,060 --> 00:03:00,820 Then we'll install Docker. 57 00:03:01,040 --> 00:03:03,679 We're going to partition our data disks, install image. 58 00:03:04,260 --> 00:03:05,359 Right, there's a lot to do today. 59 00:03:05,440 --> 00:03:09,720 So it's going to be quite a long video, hence make liberal use of the chapters. 60 00:03:10,500 --> 00:03:10,620 Okay. 61 00:03:12,020 --> 00:03:14,940 So we want to get logged in now to our Proxmox installation 62 00:03:16,360 --> 00:03:21,300 using my username and password i think i actually set a different password i do actually by the way 63 00:03:21,400 --> 00:03:26,560 have a video on how to you can probably find that up here on how to configure proxmox to log in using 64 00:03:26,740 --> 00:03:31,280 your tailscale identity instead of a username and password but we're in that kind of classic 65 00:03:31,680 --> 00:03:37,700 chicken and egg problem right now where we don't have tailscale installed on the node so we can't 66 00:03:37,820 --> 00:03:42,138 use it for like this also this is a beginner's guide and that you know replacing authentication 67 00:03:42,840 --> 00:03:49,640 is probably step seven, maybe even step 17, and we're on step one here. So just get logged in 68 00:03:49,860 --> 00:03:53,440 with the username and password and you should be all good. Now that little subscription nag there, 69 00:03:53,640 --> 00:03:59,480 back when I was a Proxmox junior, several years ago now, I thought that meant you had to pay for 70 00:03:59,580 --> 00:04:04,420 Proxmox. Don't worry, it's completely free. That little subscription nag is only there to remind 71 00:04:04,760 --> 00:04:11,019 you to contribute to the Upstream project should you wish to. You don't have to pay them a single 72 00:04:11,040 --> 00:04:16,599 penny. Now in order to make that subscription nag and everything else like go away properly, I think 73 00:04:16,600 --> 00:04:22,120 I showed you this in part one but just a quick recap, you can go to helperscripts.com and search 74 00:04:22,480 --> 00:04:28,800 for post install and then you can run this little script against your Proxmox server by taking it 75 00:04:28,880 --> 00:04:34,640 onto your clipboard, copying it and going to the node, clicking on shell and this is giving you a 76 00:04:34,830 --> 00:04:41,000 command line interface effectively like a remote shell to control that remote Proxmox instance 77 00:04:41,020 --> 00:04:43,580 You can then copy and paste it onto the terminal and go through. 78 00:04:43,690 --> 00:04:45,240 So I'm going to start the install script. 79 00:04:45,640 --> 00:04:45,760 Yes. 80 00:04:46,960 --> 00:04:47,940 I'm going to correct my sources. 81 00:04:48,460 --> 00:04:49,320 Yep, yep, yep, yep. 82 00:04:50,180 --> 00:04:50,540 Disable. 83 00:04:50,940 --> 00:04:51,040 Yep. 84 00:04:51,440 --> 00:04:52,240 Enable high availability. 85 00:04:52,880 --> 00:04:53,120 No. 86 00:04:53,360 --> 00:04:57,460 This time I made a mistake in the last video, which so many of you lovely people pointed out. 87 00:04:58,360 --> 00:04:59,440 Do I want to update it now? 88 00:04:59,600 --> 00:04:59,920 No. 89 00:05:00,110 --> 00:05:01,060 Do I want to reboot now? 90 00:05:01,180 --> 00:05:01,320 No. 91 00:05:01,580 --> 00:05:03,159 So what I'm going to do is do an apt update. 92 00:05:04,200 --> 00:05:09,039 And then the next thing that Proxmox, we should do, because it's been a couple of weeks since I touched this system, actually, 93 00:05:09,900 --> 00:05:11,979 is we're going to run PVE upgrades. 94 00:05:12,360 --> 00:05:15,460 Typically what you would do is apt upgrade with a Debian system, 95 00:05:15,550 --> 00:05:17,360 which is of course what Proxmox is based on. 96 00:05:18,080 --> 00:05:21,580 But the Proxmox project recommend that you use PVE upgrade. 97 00:05:22,320 --> 00:05:25,120 There's some Proxmox specific stuff it does in the background. 98 00:05:25,280 --> 00:05:26,700 You can see we're going to get a new kernel, 99 00:05:27,340 --> 00:05:29,159 we're going to get a whole bunch of new packages. 100 00:05:29,950 --> 00:05:33,860 And essentially it's just good practice to make sure that your box is up to date 101 00:05:33,990 --> 00:05:35,340 before you start doing anything else. 102 00:05:36,160 --> 00:05:37,380 So this will take a couple of minutes. 103 00:05:37,620 --> 00:05:46,700 I think for the most part I'm going to leave this video unedited, but when there's like a two, three minute long bit of text scrolling by, I think I'll do a cut. 104 00:05:46,900 --> 00:05:48,000 So see you shortly. 105 00:05:49,080 --> 00:05:50,599 Okay, and we're back. 106 00:05:50,890 --> 00:05:55,320 I went ahead and rebooted the node after the packages had all installed because we've got a new kernel. 107 00:05:55,840 --> 00:05:58,159 I followed that process over here in JetKVM. 108 00:05:58,190 --> 00:06:02,520 But now if I refresh this page, we are back and we are good to go. 109 00:06:03,240 --> 00:06:04,920 So what do we need to do now? 110 00:06:05,080 --> 00:06:09,740 We want to install TailScale for a couple of reasons. First of all, I don't want to be managing 111 00:06:10,040 --> 00:06:15,200 SSH keys. Like in this directory here, you can see authorized keys. There's nothing in that file. So 112 00:06:16,080 --> 00:06:21,260 I'm probably jumping ahead here. What is an SSH key, Alex? Okay. So typically when you're 113 00:06:21,480 --> 00:06:27,220 authenticating with SSH to a remote server, there has to be some kind of way for you to prove you 114 00:06:27,380 --> 00:06:32,839 are who you say you are. And typically we do that either with a username and password, or we do that 115 00:06:32,860 --> 00:06:38,700 with something called an SSH key. This uses the PKI, the public key infrastructure, kind of concepts 116 00:06:38,880 --> 00:06:44,780 of Alice and Bob to make a key really easy to reverse engineer in one direction, but hard to 117 00:06:44,940 --> 00:06:49,460 work out in the other direction. So the public and private key pairs come together to basically 118 00:06:50,040 --> 00:06:57,480 prove that I am who I say I am. But that means you have to manage SSH keys, which let's be honest, 119 00:06:57,580 --> 00:07:03,240 is, if you're familiar with the topic, it's kind of a pain. But with Tailscale SSH, there are no 120 00:07:03,340 --> 00:07:07,799 usernames, well there are usernames, there are no passwords, there are no SSH keys or anything like 121 00:07:07,920 --> 00:07:12,200 that. So first of all, that's why I want to get Tailscale on here. Secondly is I want to use 122 00:07:12,300 --> 00:07:16,900 Tailscale serve so that we don't have to worry about this pesky insecure message at the top here 123 00:07:17,020 --> 00:07:21,180 as well. And then of course, if this is a node on my tail net, then of course I can access any of 124 00:07:21,220 --> 00:07:26,199 the services running on this box from anywhere I like, such as my phone when I take a picture 125 00:07:26,220 --> 00:07:30,820 and have it upload to my Google Photos self-hosted clone, for example. 126 00:07:31,260 --> 00:07:35,380 So let's head over to tailscale.com slash download. 127 00:07:35,820 --> 00:07:38,659 We're going to get the Linux install script from here. 128 00:07:39,200 --> 00:07:40,560 We're going to copy that onto our clipboard, 129 00:07:41,080 --> 00:07:43,859 go back to Proxmox and paste that in just here. 130 00:07:46,600 --> 00:07:49,460 This will take 10, 15 seconds to install. 131 00:07:49,810 --> 00:07:53,580 So now we need to log in and create this node or add this node to our tail net. 132 00:07:54,000 --> 00:07:57,000 So we want to go to tailscale.com, no download this time. 133 00:07:57,920 --> 00:08:01,180 And in the top right-hand corner, if you don't already have a Tailnet, 134 00:08:01,340 --> 00:08:03,760 you can click on this button, get started, it's free. 135 00:08:04,420 --> 00:08:06,740 There are 100 devices and three users for free. 136 00:08:07,220 --> 00:08:10,600 And we've made a commitment that this will always be free as well. 137 00:08:10,720 --> 00:08:14,240 So you don't need to worry about rug pulls and all that kind of stuff in the future. 138 00:08:15,200 --> 00:08:18,539 I already have a Tailnet, of course, you know, might be biased, 139 00:08:18,720 --> 00:08:21,560 but I want to click on my admin console just here. 140 00:08:22,080 --> 00:08:25,500 And then you can see that actually this is a demo instance of PVE, 141 00:08:25,570 --> 00:08:26,380 so I'm going to delete that. 142 00:08:26,880 --> 00:08:30,100 But you can see I've literally only got two devices in my tail net right now. 143 00:08:30,520 --> 00:08:32,620 This laptop that I'm connected from, Baldrick, 144 00:08:32,979 --> 00:08:34,860 and the other one is my gaming rig downstairs 145 00:08:35,049 --> 00:08:37,679 as I like to stream video games sometimes over tail scale 146 00:08:39,320 --> 00:08:41,940 using Artemis and Moonlight Sunshine, all that stuff. 147 00:08:42,280 --> 00:08:43,860 I've got a video coming on that soon, 148 00:08:44,630 --> 00:08:48,560 so get subscribed, you know, like, comment, subscribe, all that good stuff. 149 00:08:49,220 --> 00:08:51,280 So now we are logged in in the browser. 150 00:08:51,440 --> 00:08:58,680 Let's go back to Proxmox and we're going to do tailscaleup-dash, two dashes is important, SSH. 151 00:08:59,260 --> 00:09:03,620 This is going to give us a URL which we're going to copy onto our clipboard and paste into the browser. 152 00:09:04,420 --> 00:09:08,140 It's then going to ask me to authenticate to my tailscale account, 153 00:09:08,470 --> 00:09:11,040 which in this case my authentication is done through Gmail. 154 00:09:12,580 --> 00:09:13,440 That bit's not important. 155 00:09:14,070 --> 00:09:17,060 Obviously you can use whatever auth provider you like when you set up your tailnet, 156 00:09:17,340 --> 00:09:20,420 but I just found Gmail the most convenient for these tutorials. 157 00:09:21,420 --> 00:09:27,199 And if we click now on visit console, you'll see that I have the PVE node is now on my 158 00:09:27,290 --> 00:09:27,540 tail net. 159 00:09:27,820 --> 00:09:31,720 So time for the big reveal, so far as SSH is concerned, at least. 160 00:09:32,340 --> 00:09:35,420 I'm now going to do SSH root at PVE. 161 00:09:35,930 --> 00:09:39,839 And that name, that string, by the way, must match the name that is specified here. 162 00:09:39,850 --> 00:09:41,560 So I could do the IP address if I want to. 163 00:09:42,080 --> 00:09:45,700 I could do the fully qualified host name of Velociraptor-Noodlefish. 164 00:09:46,600 --> 00:09:49,400 Or I can just do the node name itself, which is what I'm going to do here. 165 00:09:49,640 --> 00:09:58,000 So ssh root at PVE, no usernames, no passwords, no SSH keys, and I'm logged in to my Proxmox 166 00:09:58,250 --> 00:09:58,380 instance. 167 00:09:59,760 --> 00:10:00,980 Come on, that's pretty cool. 168 00:10:01,680 --> 00:10:05,199 So now we want to get rid of the self-signed TLS certificate. 169 00:10:05,380 --> 00:10:06,880 Now there are two ways we can do this actually. 170 00:10:06,950 --> 00:10:12,380 If we look in Google for Tailscale Proxmox, we have an article on Tailscale on a Proxmox 171 00:10:12,520 --> 00:10:12,640 host. 172 00:10:13,310 --> 00:10:14,359 And there are two things we can do. 173 00:10:14,420 --> 00:10:20,120 One of them is to enable HTTP access from the Proxmox web UI is run this little script here. 174 00:10:20,160 --> 00:10:26,480 We can generate a TailScale certificate and install it into the Proxmox, I guess, key store, certificate store. 175 00:10:27,080 --> 00:10:29,880 Or we can just press easy mode and use TailScale serve. 176 00:10:30,540 --> 00:10:31,360 So guess what I'm going to do? 177 00:10:31,660 --> 00:10:32,579 I'm going to do easy mode. 178 00:10:33,120 --> 00:10:34,860 I'm going to do sudo TailScale serve. 179 00:10:35,600 --> 00:10:36,720 Go back to my instance. 180 00:10:37,980 --> 00:10:39,140 Copy that and put that on the clipboard. 181 00:10:39,620 --> 00:10:40,360 Pseudo is not found. 182 00:10:40,620 --> 00:10:42,000 Well, I'm root anyway, so it doesn't matter. 183 00:10:43,320 --> 00:10:46,900 Pseudo, by the way, elevates your privileges if you're not familiar with what Pseudo does. 184 00:10:47,480 --> 00:10:52,140 It takes you from being like a standard user, so like Alex, and turns you into a super user, 185 00:10:52,420 --> 00:10:59,500 super user do, so S-U-D-O, Pseudo. But now you can see that I have a new node on my tail net that I 186 00:10:59,500 --> 00:11:06,380 can actually access with a TLS certificate. So if I have this domain name here of PVE Velociraptor, 187 00:11:06,760 --> 00:11:12,619 if I copy that onto my clipboard, now this will take 10, 15, 20 seconds the first time 188 00:11:13,120 --> 00:11:17,880 because Tailscale now on the back end is reaching out to a certificate provider called Let's Encrypt 189 00:11:17,880 --> 00:11:24,540 which is completely free and generating you a TLS or an HTTPS certificate, an encryption certificate. 190 00:11:25,700 --> 00:11:30,200 And there you go. In real time there were no cuts or edits there. You can see that I'm now accessing 191 00:11:30,440 --> 00:11:36,400 my Proxmox installation over Tailscale with a certificate. Now a couple of important things I 192 00:11:36,400 --> 00:11:42,939 want to point out. This address is only available within your tail net. Tailscale also offer a 193 00:11:43,060 --> 00:11:46,900 product called Tailscale Serve. I say product, it makes it sound like it costs money. It doesn't, 194 00:11:46,900 --> 00:11:51,420 it's free, it's on the free tier. But Tailscale Funnel does the exact same thing as Serve, 195 00:11:52,080 --> 00:11:56,520 except it makes it available on the public internet. Now, please don't go and put your 196 00:11:56,700 --> 00:12:02,160 Proxmox server on the public internet. It's just not a good idea for many, many reasons. 197 00:12:02,840 --> 00:12:03,480 Just don't do it. 198 00:12:03,990 --> 00:12:06,340 But if you have an application you want to share with friends and family 199 00:12:06,500 --> 00:12:08,280 who aren't using Tailscale for some reason, 200 00:12:08,800 --> 00:12:11,500 or you want to share a prototype of a website you're working on 201 00:12:11,500 --> 00:12:15,080 or a project you have hosted locally with somebody from your laptop or whatever, 202 00:12:15,560 --> 00:12:19,079 Tailscale Funnel is designed and works really well for that use case. 203 00:12:19,740 --> 00:12:22,660 It's not very well suited to long-running use cases 204 00:12:23,360 --> 00:12:27,260 like hosting stuff like a Proxmox interface or something like that. 205 00:12:27,460 --> 00:12:29,220 So anyway, back to the point. 206 00:12:30,340 --> 00:12:36,700 Tailscale serve makes this interface of the Proxmox UI available within your tail net. 207 00:12:36,790 --> 00:12:40,180 So now anywhere you are connected to Tailscale, 208 00:12:40,660 --> 00:12:46,199 you can also now connect to your Proxmox instance using this fully qualified domain name. 209 00:12:46,740 --> 00:12:47,940 Now I use that phrase quite a lot. 210 00:12:47,940 --> 00:12:50,300 You might see FQDN in a lot of stuff. 211 00:12:50,880 --> 00:12:51,680 That's what it means. 212 00:12:51,710 --> 00:12:57,040 The fully qualified domain name here of velociraptor-noodelfish.ts.net, 213 00:12:57,680 --> 00:12:59,180 that's the fully qualified domain name. 214 00:12:59,920 --> 00:13:03,800 Now a couple of things I didn't mention which I probably should do before we get off this topic. 215 00:13:04,580 --> 00:13:09,280 Under DNS you've got to make sure that you have a tail net name so by default out of the box 216 00:13:09,720 --> 00:13:14,660 all tail nets come with this kind of like placeholder name it's not memorable it's a 217 00:13:14,670 --> 00:13:19,860 little bit ugly but you get it for free. You also get a real name for free of something with a tail 218 00:13:20,200 --> 00:13:25,379 and something with scales if you roll the dice and come up with a unique name for your tail net too 219 00:13:25,460 --> 00:13:27,280 So go ahead and make that change there. 220 00:13:28,000 --> 00:13:33,740 In order to actually utilize the DNS name and the HTTPS certificates as well, 221 00:13:33,870 --> 00:13:35,300 on a fresh tail net at least, 222 00:13:35,740 --> 00:13:37,920 you'll need to make sure that Magic DNS is turned on 223 00:13:38,380 --> 00:13:41,540 and the HTTPS certificates are turned on as well. 224 00:13:42,660 --> 00:13:46,819 So with that done, that's the basics of configuring tail scale on Proxmox. 225 00:13:47,360 --> 00:13:49,880 The next thing we want to do is go ahead and install Docker. 226 00:13:50,320 --> 00:13:53,539 So I'm going to go over to get.docker.com 227 00:13:53,600 --> 00:13:56,600 and just copy the first little bit of this script right here. 228 00:13:57,600 --> 00:14:00,180 I'm not going to worry about the O install Docker part. 229 00:14:01,800 --> 00:14:05,819 I'm going to paste that into my clipboard, do a pipe to SH, 230 00:14:06,260 --> 00:14:09,160 and this is going to install Docker on my Proxmox host. 231 00:14:09,880 --> 00:14:11,340 Now, Docker, you've probably heard of this. 232 00:14:11,540 --> 00:14:16,640 It's a containerization engine that lets you run containerized applications on Proxmox. 233 00:14:17,320 --> 00:14:20,840 Now, there are a lot of different schools of thought, shall I say, 234 00:14:21,120 --> 00:14:26,980 as to whether you should install things directly on the Proxmox host, or create virtual machines and put things in virtual machines, 235 00:14:27,500 --> 00:14:33,180 or create what are called LXC containers, or LX containers, because the C already means containers. 236 00:14:35,620 --> 00:14:38,620 Anyway, to be honest with you though, this is a beginner's guide, okay? 237 00:14:38,950 --> 00:14:48,560 And I want to keep things as simple as I can, whilst also giving you just enough breadcrumbs to follow for you to start playing with that stuff moving forward. 238 00:14:48,760 --> 00:14:53,140 So for today, we're going to put everything on the Proxmox host itself. 239 00:14:53,840 --> 00:14:55,040 We're not going to do any VMs. 240 00:14:55,260 --> 00:14:56,700 We're not going to do any LXCs. 241 00:14:57,070 --> 00:15:02,000 But what we are going to do is we are going to use Docker Compose to declaratively declare 242 00:15:02,640 --> 00:15:07,140 what all of our containers look like on the Proxmox host with a text file. 243 00:15:07,760 --> 00:15:13,860 So with Docker install, we're going to do docker run dash dash rm it hello world just to prove 244 00:15:13,870 --> 00:15:14,920 that Docker is actually working. 245 00:15:15,620 --> 00:15:16,660 And hello from Docker. 246 00:15:16,740 --> 00:15:20,860 This message shows that your installation appears to be working correctly. 247 00:15:21,740 --> 00:15:22,040 Hooray! 248 00:15:22,840 --> 00:15:24,820 Okay, so I'm looking at my little list here. 249 00:15:25,340 --> 00:15:28,460 The only thing we've got left to do now is partition our disk. 250 00:15:28,900 --> 00:15:30,180 So how do we do that? 251 00:15:30,220 --> 00:15:30,980 Our data disk. 252 00:15:31,180 --> 00:15:34,520 Now remember when I showed you in part one the hardware for this thing? 253 00:15:35,080 --> 00:15:36,620 There are two disks in this system. 254 00:15:37,200 --> 00:15:40,860 The first one is a NVMe SSD. 255 00:15:41,040 --> 00:15:42,199 So that's this one up here. 256 00:15:42,720 --> 00:15:46,660 and this is a Samsung 980 500 gigabyte NVMe SSD. 257 00:15:47,560 --> 00:15:49,579 This is where Proxmox is installed to. 258 00:15:49,700 --> 00:15:51,300 This is where your Docker containers will be running 259 00:15:51,920 --> 00:15:55,699 but we want to make sure that their data persists somewhere else 260 00:15:56,520 --> 00:15:57,740 such that we can back it up later 261 00:15:57,900 --> 00:15:59,819 and again, this is a beginner's guide. 262 00:16:00,240 --> 00:16:03,220 We will probably come on to backups in a future part 263 00:16:03,280 --> 00:16:05,920 although I'm not promising anything to be part of this series. 264 00:16:06,620 --> 00:16:10,340 I think a dedicated video on data backups over Tailskate 265 00:16:10,340 --> 00:16:11,259 is probably warranted 266 00:16:12,060 --> 00:16:19,520 but what we want to do is create a partition on this disk here of sda our sata ssd and 267 00:16:20,220 --> 00:16:28,260 create a file system on it so remember that little phrase there sda now you don't want to really rely 268 00:16:28,820 --> 00:16:37,060 on those identifiers to reliably exist to identify your disks if and in our case this won't happen 269 00:16:37,060 --> 00:16:41,380 in this little Dell box. But let's say you build a server with four, five, six, seven, eight different 270 00:16:41,620 --> 00:16:47,560 SSDs in it and you sort of move them around. It's possible that on each reboot those devices can 271 00:16:47,760 --> 00:16:53,040 enumerate with different namings. So if you start putting config files together based on SDA 272 00:16:53,880 --> 00:16:59,200 it can sometimes happen that that name will change and then the config file is invalid. 273 00:16:59,570 --> 00:17:03,980 What we want to do is, well first of all we need to create the partitions and then we'll come on 274 00:17:03,980 --> 00:17:06,680 how to actually access the data that's stored on those disks. 275 00:17:07,420 --> 00:17:08,900 But first of all, now this is, 276 00:17:09,740 --> 00:17:11,459 you've got to be careful with this next command, okay? 277 00:17:11,920 --> 00:17:13,439 We're going to use wipefs, 278 00:17:13,930 --> 00:17:15,699 and I'm going to put in devsda. 279 00:17:17,240 --> 00:17:21,540 Be warned, this will delete all the data on your disks. 280 00:17:21,880 --> 00:17:24,819 You can see here that I have, on sda itself, 281 00:17:25,220 --> 00:17:27,120 I have three different entries, 282 00:17:27,410 --> 00:17:30,400 and then under sda1, which is the first partition on this disk, 283 00:17:30,860 --> 00:17:32,760 I have one ext4 partition. 284 00:17:33,520 --> 00:17:38,540 XT4 refers to the name of the file system. So you know that binder you used to carry to school every 285 00:17:38,700 --> 00:17:42,840 day that had like different plastic wallets in it? You can kind of think of those wallets as like 286 00:17:43,280 --> 00:17:48,580 partitions almost. So you've got the big binder which is the disk and then inside the binder are 287 00:17:48,700 --> 00:17:53,740 the different plastic wallets and typically when you're doing a data disk like this you probably 288 00:17:53,880 --> 00:17:58,999 just want one giant partition which is what we have here but I'm going to create it for you on 289 00:17:59,020 --> 00:18:06,600 the stream uh on the video at least in in real time but when you're using um a used disc or even 290 00:18:06,840 --> 00:18:11,060 sometimes when you buy a brand new disc they come for pre-formatted with ntfs or like you you just 291 00:18:11,180 --> 00:18:16,700 don't know what's happened to them before so it's probably a good idea although please exercise 292 00:18:16,900 --> 00:18:21,100 caution double check the commands you're about to run in this next section because they are destructive 293 00:18:21,940 --> 00:18:29,220 so I'm going to go ahead and just do a wipefs minus a on sda1 and then sda and this is going 294 00:18:29,220 --> 00:18:34,940 to remove all of those different signatures that we had on the disk and again if I do wipefs without 295 00:18:36,080 --> 00:18:41,740 without any any commands you can see that nothing exists on the disk now it's completely empty 296 00:18:42,420 --> 00:18:48,839 so if there was data stored on that disk it's now unless you send it to drive savers or something 297 00:18:48,860 --> 00:18:57,600 it's now gone so please please double check before you run wipefs on a disk exercise some caution and 298 00:18:57,740 --> 00:19:02,560 don't just run it willy-nilly okay now we want to create a partition next so i'm going to do 299 00:19:02,980 --> 00:19:06,300 gdisk which is the application i'm going to use to create a gpt partition table 300 00:19:07,160 --> 00:19:13,820 i'm going to press o for a new you know gpt mbr i'm going to select yes and then i'm going to 301 00:19:13,840 --> 00:19:17,619 create a new partition remember we're just creating the plastic wallet at this point that everything 302 00:19:17,680 --> 00:19:23,980 lives within we're not actually creating the file system yet which is how do you explain that okay 303 00:19:24,100 --> 00:19:27,860 so you've got the binder then you've got the plastic wallet and then with inside the wallet is the 304 00:19:28,300 --> 00:19:33,740 file system is the contents i suppose is the best way to think of it um and then i'm going to do 305 00:19:33,900 --> 00:19:40,659 right here so we now have one partition on this disk and we can we can look at that by doing 306 00:19:41,619 --> 00:19:49,659 fdisc-l dev-sda. You can see that sda1 now exists. So I mentioned a moment ago that we don't 307 00:19:50,060 --> 00:19:56,000 really want to refer to that sda moniker unless we absolutely have to. So what do we do instead? 308 00:19:56,740 --> 00:20:04,859 Well if we go to dev-disc-by-id we actually get a list of all the disks connected to the system 309 00:20:05,420 --> 00:20:07,460 with their constituent serial numbers. 310 00:20:08,140 --> 00:20:11,600 So this means that this is a unique identifier for the disk, 311 00:20:12,180 --> 00:20:13,680 much in the same way that DevSDA is. 312 00:20:13,710 --> 00:20:15,520 And you can see it's actually just a symlink anyway. 313 00:20:16,640 --> 00:20:21,940 So really for me, this is the best way to refer to disks in your system. 314 00:20:22,280 --> 00:20:25,000 So what we want to do now is create that file system 315 00:20:25,540 --> 00:20:28,360 using the ATA SPCC blah, blah, blah. 316 00:20:29,560 --> 00:20:31,440 So by the way, if you want to clear your screen, 317 00:20:31,850 --> 00:20:33,320 you can do a Control-L. 318 00:20:33,480 --> 00:20:37,080 You can also type clear, but I always prefer control L. 319 00:20:37,320 --> 00:20:40,120 So just a free tip for you there. 320 00:20:40,570 --> 00:20:42,780 Now we want to edit a file called fstab. 321 00:20:43,380 --> 00:20:45,000 So we're going to use Vim to do that. 322 00:20:45,210 --> 00:20:48,340 So type VI, edit the fstab. 323 00:20:48,340 --> 00:20:50,020 You can use nano as well if you would prefer. 324 00:20:50,680 --> 00:20:54,100 Now, when I open Vim, I'll try and talk you through the keystrokes 325 00:20:54,260 --> 00:20:55,900 because I really love Vim. 326 00:20:56,000 --> 00:20:58,500 It's one of those editors that once you start using it, 327 00:20:58,580 --> 00:21:01,600 and I've been using it now for maybe seven, eight, nine years, 328 00:21:02,740 --> 00:21:07,000 There is a hurdle to get there, but I promise you it's worth it. 329 00:21:07,740 --> 00:21:09,400 All right, so you open Vim. 330 00:21:09,860 --> 00:21:10,879 You do a Shift-G. 331 00:21:11,550 --> 00:21:12,940 That takes you to the bottom of the file. 332 00:21:13,600 --> 00:21:17,040 You now press O, and this puts you on the next line, 333 00:21:17,090 --> 00:21:19,100 but it also puts you into insert mode, 334 00:21:19,170 --> 00:21:20,400 which means you can actually type stuff, 335 00:21:21,200 --> 00:21:23,600 because that's something that often confuses newbies with Vim. 336 00:21:24,340 --> 00:21:28,840 So we're going to do slash dev slash disk slash by hyphen ID, 337 00:21:29,600 --> 00:21:31,679 and then put in the name of our partition. 338 00:21:33,200 --> 00:21:38,400 we are now going to do mount ssd so this is where we're going to mount the data directory to 339 00:21:39,100 --> 00:21:42,820 we are then going to mention the file system type that we are using so in this case 340 00:21:43,320 --> 00:21:47,439 i want to keep things incredibly simple excruciatingly simple for this video 341 00:21:48,200 --> 00:21:56,580 we could use zfs here we could use butterfs or bcachefs but each of those things are what are 342 00:21:56,580 --> 00:22:02,399 called copy and write file systems they they they can do things like snapshots and replication 343 00:22:03,300 --> 00:22:10,960 and they have a huge amount of features but again like that's step 73 in and we're on step one or 344 00:22:11,100 --> 00:22:17,540 step two here so i want to keep it really simple with ext4 um it's a really old tried and trusted 345 00:22:17,570 --> 00:22:21,520 and true file system on linux if you want to use something else at this point please go ahead and 346 00:22:21,640 --> 00:22:26,540 do that i won't uh i won't come and mark your homework down for doing it but if you're just 347 00:22:26,560 --> 00:22:34,139 long ext4 will do you just fine for now next we want to put in defaults no a time and discard 348 00:22:34,820 --> 00:22:41,899 some basic stuff here for the fs tab file and then we are done so to exit insert mode we press escape 349 00:22:42,720 --> 00:22:49,940 and then we do colon write colon w and then quit and now that file has been modified so if we do fs 350 00:22:50,000 --> 00:22:57,100 tab, we can see here that the edits we made have been persisted, I guess. Now we want to create the 351 00:22:57,200 --> 00:23:05,820 far system on this disk. I don't think I did that, did I? So we want to do makefs.ext4 and then put 352 00:23:05,900 --> 00:23:11,760 in the partition that we want to put ext4 onto. That's now created the ext4 partition on the disk 353 00:23:12,080 --> 00:23:16,820 for us. The last thing we have to do is create the mount point. This is where the disk is actually 354 00:23:16,840 --> 00:23:23,520 going to be mounted by proxmox actually i'm going to create mount ssd1 because who knows maybe we 355 00:23:23,620 --> 00:23:28,800 add another ssd later and then that means i've got to edit my fs tab again so i know i want to look 356 00:23:28,800 --> 00:23:34,020 for the phrase ssd so if i press forward slash ssd that'll take me right to the part of the file i 357 00:23:34,120 --> 00:23:41,580 want to go to and then i can do insert one so insert it means letter i type the number one press 358 00:23:41,600 --> 00:23:47,080 escape, press colon, write quit, and trust me, this stuff becomes muscle memory after a while. 359 00:23:47,600 --> 00:23:51,060 If you've been looking for a way to start Vim, Vim Tutor is a really good way to do it. Stick that 360 00:23:51,080 --> 00:23:55,780 into Google, you'll probably lose an evening to it, but you're welcome. All right, so we now have 361 00:23:56,400 --> 00:24:02,020 FSTAB created, we have a file system on the disk, and I think we're good to go. So let's do mount A. 362 00:24:04,100 --> 00:24:10,060 Ah yes, we need to do systemctl daemon reload to pick up the new FSTAB file that we just created. 363 00:24:10,800 --> 00:24:17,560 mount-a and we can type mount again and we can see that this disc is now mounted on our system. 364 00:24:18,260 --> 00:24:24,240 One last tip, here's a new app that I just found that I absolutely adore, it's called DUF. It just 365 00:24:24,360 --> 00:24:29,479 prints you out a really nice, easy to read, like overview of all the different things on your system. 366 00:24:29,660 --> 00:24:33,540 There's a bunch of other stuff you can do with it if you do dash dash help. We won't get into that 367 00:24:33,560 --> 00:24:40,820 for today. So I think if I look back at my original running sheet, we've done all of the 368 00:24:40,960 --> 00:24:48,280 Proxmox setup piece now, which means the next chapter is going to be installing Image. Next up, 369 00:24:48,440 --> 00:24:53,500 it's time to install Image, the self-hosted Google Photos clone. And you can find them over at 370 00:24:53,700 --> 00:24:59,460 image.app. Now they have a wonderful getting started section on their website, but we're 371 00:24:59,480 --> 00:25:03,860 going to do things slightly differently. For example, they recommend that you use an end file 372 00:25:04,000 --> 00:25:08,340 with your Docker Compose file. There's a couple of things I'm not going to do the way they recommend. 373 00:25:08,440 --> 00:25:12,880 I just prefer to keep things fully declarative and have everything in just one single file. 374 00:25:13,440 --> 00:25:19,480 So link in the description is a copy of this file and the reason I modified it slightly is for a few 375 00:25:19,640 --> 00:25:25,200 reasons. First of all, we want to put image on our tail net. So we're going to do that using this 376 00:25:25,540 --> 00:25:31,379 sidecar method and this effectively creates so you've got the image application server over here 377 00:25:31,820 --> 00:25:36,600 and then you've got the image tail scale connection server we kind of merge those two things together 378 00:25:36,800 --> 00:25:40,760 we've done this many times on the channel now you kind of merge these two things together using this 379 00:25:40,940 --> 00:25:46,640 network mode command here and it basically puts image directly onto your tail net so you can access 380 00:25:46,680 --> 00:25:51,780 it from anywhere in the world using tail scale serve with no reverse proxy configuration required 381 00:25:52,540 --> 00:25:57,200 so in the description down below will be this file the whole thing there's several containers in here 382 00:25:57,400 --> 00:26:02,160 you've got the image ts container first of all you've then got the image application server 383 00:26:02,700 --> 00:26:05,940 container and these paths will come on to these in just a minute don't worry 384 00:26:06,720 --> 00:26:11,120 you've also got the image machine learning container this one's pretty interesting and 385 00:26:11,120 --> 00:26:17,199 i have a video linked up here where you can look at how to do remote gpu machine learning for image 386 00:26:17,240 --> 00:26:22,300 So if you're importing 100,000 images or something, you could have an NVIDIA GPU in your gaming rig, 387 00:26:22,780 --> 00:26:26,860 actually do all of the processing and machine learning and face recognition for image, 388 00:26:27,320 --> 00:26:30,340 and spare the poor CPU of your little Dell box or something like that. 389 00:26:31,040 --> 00:26:34,379 We're just going to run this all in CPU mode today and all in one place, 390 00:26:34,440 --> 00:26:37,580 but if you did want to do remote learning, like I say, there's a link to a video. 391 00:26:37,980 --> 00:26:38,900 I've already done about that. 392 00:26:39,640 --> 00:26:43,120 Now, Redis is a piece of software that essentially just acts like a sponge. 393 00:26:43,380 --> 00:26:50,260 When you're adding all of those pictures, it's not necessarily the case that Image can soak up all of that pressure all at once. 394 00:26:50,480 --> 00:26:53,520 So Redis kind of just acts like a buffer, if you like. 395 00:26:53,880 --> 00:27:01,320 It pulls in all of this, all the stuff and kind of queues it up and stores it temporarily until Image can actually get to processing it later on. 396 00:27:01,340 --> 00:27:03,500 So it's a queuing piece of software. 397 00:27:03,760 --> 00:27:06,120 So if you ever wonder what Redis does, that's what it does. 398 00:27:06,760 --> 00:27:12,520 And then you've got the database, of course, which is a very important piece of software using Postgres in this case. 399 00:27:13,080 --> 00:27:17,120 Now, the way that Docker works, we're going to need to do something with what are called volumes. 400 00:27:17,860 --> 00:27:22,379 These are a way to persist data outside of the container runtime environment, 401 00:27:23,080 --> 00:27:25,320 such that when you destroy and recreate the Docker containers, 402 00:27:25,860 --> 00:27:29,060 all of your databases, all of your pictures and everything remain intact, 403 00:27:29,520 --> 00:27:31,160 which is obviously what we want. 404 00:27:31,380 --> 00:27:33,960 So we've got to make sure that some of these paths exist. 405 00:27:34,320 --> 00:27:39,379 Now, on our Dell box, we already know that this path exists of mount SSD1 as defined here. 406 00:27:39,960 --> 00:27:45,240 But if this data path doesn't exist, Docker will go ahead and try and create it. 407 00:27:45,350 --> 00:27:50,840 However, further up in our image TS thing, we need to create these paths here 408 00:27:51,030 --> 00:27:55,379 because we've got to put a couple of config files in there in order to configure the tailscale container. 409 00:27:55,600 --> 00:27:57,679 So let's go ahead and create those paths. 410 00:27:57,840 --> 00:27:59,959 I've just copied that path onto my clipboard. 411 00:28:00,760 --> 00:28:04,300 Again, via SSH, I'm going to do make dir minus P. 412 00:28:04,740 --> 00:28:11,360 It's going to create this whole folder path for us of mount ssd1 at data image tsconfig. 413 00:28:11,960 --> 00:28:14,460 I'm also going to do the same thing with tsstate. 414 00:28:16,920 --> 00:28:20,000 By the way, if you want to delete the whole string, you can do a ctrl-w, 415 00:28:20,620 --> 00:28:24,040 and that will delete the entire word behind the cursor. 416 00:28:25,580 --> 00:28:30,659 And then on image server, we also want to make sure that we have this directory actually exists. 417 00:28:31,820 --> 00:28:34,200 It may already contain data in your case. 418 00:28:34,740 --> 00:28:39,300 you know you might already have a directory with folders in it but I don't think we do here do we 419 00:28:39,500 --> 00:28:44,360 no data does not exist so we don't have to create this in this case because like I say image would 420 00:28:44,360 --> 00:28:49,540 go ahead and automatically create it for us but it can't hurt to create these directories now I 421 00:28:49,700 --> 00:28:53,660 don't think I have this app installed so I'm going to install it right away tree is an application 422 00:28:54,080 --> 00:28:58,820 that lets you list out directory structures okay so you can see here we've now created a few 423 00:28:58,840 --> 00:29:05,179 different directories. We've got app data, image, tsconfig, tsstate. We've got data, photos, upload. 424 00:29:05,480 --> 00:29:09,980 And this is just reflecting what's in our Docker compose file. Now in terms of what we need to do, 425 00:29:10,000 --> 00:29:16,660 we need to put a few files in a few places. So let's create in here, we've got app data image. 426 00:29:16,760 --> 00:29:22,600 So in that folder, let's go to here to app data image. We're going to create a new file called 427 00:29:22,640 --> 00:29:29,780 compose.yaml but we're going to do that from vs code now if you didn't know tailscale make a vs 428 00:29:29,920 --> 00:29:34,260 code extension so you can go to the extensions option over here search for tailscale and install 429 00:29:34,400 --> 00:29:39,940 that directly into your vs code editor the benefit of this is you can now click on this little tail 430 00:29:40,080 --> 00:29:44,939 scale button and you can see all of the nodes in your tail net now okay i've only got a couple 431 00:29:45,500 --> 00:29:49,640 but we want to do things like change the ssh username i'm going to change mine to root 432 00:29:50,180 --> 00:29:52,140 and then I'm going to change the path. 433 00:29:52,710 --> 00:29:53,800 I'm going to right click 434 00:29:54,060 --> 00:29:56,760 and then change root directory to root. 435 00:29:57,080 --> 00:29:57,899 I think by default, 436 00:29:58,220 --> 00:29:59,760 it's the home directory of the root user, 437 00:30:00,300 --> 00:30:02,159 but I want access to the entire system. 438 00:30:02,880 --> 00:30:04,360 And now if I click this little caret icon 439 00:30:04,660 --> 00:30:05,560 next to this and expand, 440 00:30:06,220 --> 00:30:07,000 you can see I've got access 441 00:30:07,070 --> 00:30:09,240 to the entire file system of this remote node 442 00:30:09,750 --> 00:30:10,340 over tailscale. 443 00:30:10,480 --> 00:30:13,080 Remember, we haven't done any usernames 444 00:30:13,080 --> 00:30:14,580 or passwords or SSH keys 445 00:30:14,610 --> 00:30:15,479 or anything like that 446 00:30:15,640 --> 00:30:17,260 to kind of verify identity. 447 00:30:18,200 --> 00:30:22,800 All we've done is installed TailScale in both places and logged in, and it handles the rest. 448 00:30:22,960 --> 00:30:23,780 It really is magic. 449 00:30:24,760 --> 00:30:30,560 Okay, so under MNT SSD1, we can see the same data structure that we just created in the command line. 450 00:30:31,180 --> 00:30:34,860 And this is useful for us today because we need to put a few files in place. 451 00:30:35,240 --> 00:30:36,840 So I need to rename that to image. 452 00:30:37,980 --> 00:30:41,980 By the way, this file is, of course, linked in the Git repo in the description down below. 453 00:30:43,080 --> 00:30:45,280 But under here, we've got a couple of files to move around. 454 00:30:45,580 --> 00:30:48,300 So I need to copy this image.json file. 455 00:30:48,780 --> 00:30:50,680 I'm going to just copy this onto my clipboard 456 00:30:51,360 --> 00:30:53,479 and then go over to the tailscale extension. 457 00:30:54,240 --> 00:30:56,860 And in TS config, I'm going to create a new file 458 00:30:56,860 --> 00:31:02,179 by right-clicking new file and call it image.json. 459 00:31:02,560 --> 00:31:04,139 So I'm just going to copy the contents of that 460 00:31:04,240 --> 00:31:07,180 into my image.json file on the remote server now. 461 00:31:07,860 --> 00:31:10,919 Okay, so we've got our reverse proxy configuration here done. 462 00:31:10,960 --> 00:31:13,320 So this is going to handle configuring tailscale serve 463 00:31:13,340 --> 00:31:18,860 for us programmatically as part of the container deployment. We also need to make sure that we've 464 00:31:18,960 --> 00:31:25,160 got our auth key. So over at tailscale.com we can generate ourselves an auth key by going to our 465 00:31:25,310 --> 00:31:32,620 admin console, settings, keys and then generate an auth key and I'm going to call this one image 466 00:31:33,000 --> 00:31:37,160 test. I'm going to make it reusable because I'm doing a demo and I'll probably tear things up and 467 00:31:37,280 --> 00:31:42,120 down a few times. You can leave this completely by default if you would like to. Now I'm going to 468 00:31:42,120 --> 00:31:44,780 copy my auth key into my Docker Compose file, 469 00:31:46,080 --> 00:31:48,260 just replacing this TS auth key bit here. 470 00:31:49,280 --> 00:31:52,120 And now I'm going to take this entire Compose file 471 00:31:53,240 --> 00:31:56,100 and I'm going to put it into this image directory right here. 472 00:31:56,600 --> 00:31:59,360 So I'm going to click on new file, compose.yaml. 473 00:32:00,260 --> 00:32:04,180 I'm going to open that, paste, and now we are good to go. 474 00:32:04,780 --> 00:32:07,160 So if I do a control back tick, 475 00:32:07,860 --> 00:32:10,040 that's going to bring me up the built-in terminal. 476 00:32:10,560 --> 00:32:16,260 Or if I want to open a terminal via tailscale in the exact directory that I want to be in, 477 00:32:16,610 --> 00:32:18,580 I can just click on this little button here in the extension, 478 00:32:19,290 --> 00:32:21,820 and it takes me right to where I want to be. 479 00:32:22,730 --> 00:32:23,240 Isn't that cool? 480 00:32:24,050 --> 00:32:28,460 Okay, so for the purposes of video, I'm going to make things slightly bigger 481 00:32:29,400 --> 00:32:31,600 and just have things here. 482 00:32:31,930 --> 00:32:34,080 Okay, so we have our compose file. 483 00:32:34,670 --> 00:32:35,540 Again, I'm going to run tree. 484 00:32:36,120 --> 00:32:37,239 We have our compose file. 485 00:32:37,330 --> 00:32:38,939 I think everything's set up in there. 486 00:32:39,120 --> 00:32:45,419 we have our JSON image file to. It's time we started things up. So let's do a Docker Compose 487 00:32:45,560 --> 00:32:51,580 pull. This is going to pull all of the images that we need to run image locally, which in my case took 488 00:32:51,740 --> 00:32:58,520 about 45 seconds. I'm now going to do Docker Compose up minus D. And then just to view the logs and 489 00:32:58,620 --> 00:33:02,239 double check about everything's going on and configured correctly, I'm going to do Docker 490 00:33:02,260 --> 00:33:09,200 overcompose logs minus f and all being well this is going to do several things it's going to spin 491 00:33:09,200 --> 00:33:14,360 up the database it's going to spin up image it's going to add image to my tail net and hopefully 492 00:33:14,780 --> 00:33:20,540 everything will just work hopefully i've sacrificed enough to the demo gods today okay first things 493 00:33:20,680 --> 00:33:25,280 first we're off to a good start the image container has automatically added itself to my tail net so 494 00:33:25,280 --> 00:33:31,360 i'm going to copy this url here and if everything worked correctly it's now going to go away in the 495 00:33:31,360 --> 00:33:37,879 background and yet start generating a certificate for image.velociraptor again this can take a 496 00:33:38,140 --> 00:33:43,160 a minute or two just like the proxmox one did it's generating the certificate requesting the 497 00:33:43,200 --> 00:33:48,200 certificate and voila we're done we've deployed image now i get a lot of feedback from people 498 00:33:48,320 --> 00:33:53,260 saying that we need we need a ui for docker we need a ui to manage our containers and i do 499 00:33:53,500 --> 00:33:59,140 appreciate that by the time you have to drop to the terminal you've already lost a good portion 500 00:33:59,160 --> 00:34:04,980 of your audience but the reality of self-hosting at least in 2025 at least is you do still have to 501 00:34:05,060 --> 00:34:10,379 roll your sleeves up and get a little bit dirty however it's a lot easier than it used to be we 502 00:34:10,679 --> 00:34:16,520 just simply deployed two files two yaml files and i think that's probably within the realm of most 503 00:34:16,600 --> 00:34:22,580 people's ability to just deploy two files we've got the compose yaml and the image json and that's 504 00:34:22,679 --> 00:34:27,500 it reverse proxy is taken care of it's on our tail net and we can access this now from anywhere in the 505 00:34:27,500 --> 00:34:32,340 world. So let's just have a very quick poke around with an image. Let's click on get started. Admin 506 00:34:32,820 --> 00:34:39,360 email. Yeah. Okay. Right. I'm just going to skip past this stuff because I don't think we really 507 00:34:39,480 --> 00:34:44,520 need to worry about it. And the storage template thing, I see stability issues here. I'm just going 508 00:34:44,540 --> 00:34:49,500 to ignore it. I'm going to leave it disabled. I don't want my photos to be unstable. I also added 509 00:34:49,800 --> 00:34:54,640 a few photos from my personal collection here just so we can see what's going on. And I want to show 510 00:34:54,659 --> 00:35:00,480 you in real time, actually I don't think I have HTOP installed, let's be fast, I want to show you 511 00:35:00,540 --> 00:35:05,279 just how much CPU Image is actually using. So you can see that just for a few seconds there it was 512 00:35:05,380 --> 00:35:10,880 using all four CPU cores to 100%. That's because in the background Image is doing a whole bunch of 513 00:35:11,080 --> 00:35:15,759 machine learning on these images to detect what's in them. So I know that all happened very fast but 514 00:35:15,880 --> 00:35:21,500 let's just do something like search for the word road. Image is now using its machine learning 515 00:35:21,600 --> 00:35:27,100 capabilities to look for anything in the images that looks like a road or indeed let's go for 516 00:35:27,620 --> 00:35:32,000 train i know some of these are really easy and basic but you can start doing things like 517 00:35:33,460 --> 00:35:39,220 what should we do tree sunset you can start concatenating these things together 518 00:35:39,900 --> 00:35:43,860 an image will go and find you know look at this this this is not even clearly sunset 519 00:35:44,580 --> 00:35:49,259 you've just got a little bit of golden light on a mountain in yosemite and it works out what's 520 00:35:49,280 --> 00:35:54,340 going on like obviously this bison picture at sunset is clearly sunset but I just think it's 521 00:35:54,640 --> 00:35:59,720 absolutely phenomenal we're doing all of this without a GPU now admittedly there are only 522 00:36:01,200 --> 00:36:05,899 15 images you can imagine if you start putting 100,000 images through this thing it's going to 523 00:36:06,040 --> 00:36:11,460 start crying and being like oh just where the GPU comes in but like I said there's a video about that 524 00:36:11,720 --> 00:36:16,600 up here so a couple of things to pay attention to in the settings of image you can see there is lots 525 00:36:16,620 --> 00:36:20,940 of stuff going on here. An interesting one for tail scale users might be the partner sharing 526 00:36:21,220 --> 00:36:25,620 feature. Now you're going to need to go into your image settings, create a new account and then add 527 00:36:25,620 --> 00:36:30,440 a partner and you can see that, well let's actually do that in real time so I can show you. 528 00:36:31,300 --> 00:36:35,520 Show don't tell Alex, that's what you need to do. So let's just do test at test.com, 529 00:36:36,920 --> 00:36:45,120 ABC123, see if it lets me do that one. Test, okay let's create that user. Cool, yes test, yeah fine. 530 00:36:46,240 --> 00:36:50,180 Let's go to account settings and create the partner sharing option. 531 00:36:50,860 --> 00:36:58,820 This is neat because it lets you effectively share all your photos and videos with your partner. 532 00:36:59,220 --> 00:37:04,580 So you can have two people access this Image instance because the lead developer of Image, 533 00:37:04,760 --> 00:37:07,960 a chap also called Alex, excellent name by the way, 534 00:37:08,840 --> 00:37:10,980 he just wanted a way to share his photos with his wife. 535 00:37:11,200 --> 00:37:15,220 Image began as a way for this guy to scratch his own itch to replace Google Photos. 536 00:37:15,640 --> 00:37:20,000 And it's developed into this absolutely glorious project that we have in front of us now. 537 00:37:21,480 --> 00:37:22,160 And that's really it. 538 00:37:22,480 --> 00:37:24,100 There's a lot more I could dig into with Image. 539 00:37:24,360 --> 00:37:26,620 I'm not going to in the interest of time today. 540 00:37:27,660 --> 00:37:31,859 Because next up on our agenda is installing our audiobook app. 541 00:37:32,720 --> 00:37:35,839 I promised you an introduction to the wonderful world of self-hosting. 542 00:37:35,840 --> 00:37:39,220 And so far, we've looked at how to replace Google Photos with Image. 543 00:37:39,920 --> 00:37:43,520 And now we're going to look at how to replace Audible with Audiobookshelf. 544 00:37:44,420 --> 00:37:50,320 The ecosystem of applications is constantly growing and in fact there's a whole list over at Awesome 545 00:37:51,000 --> 00:37:57,000 self-hosted on GitHub where if you want to find out more software to host there's a huge list on 546 00:37:57,080 --> 00:38:02,340 here. So if I type in audio bookshelf for example there it is under media streaming audio streaming 547 00:38:02,800 --> 00:38:07,360 there's a bunch of stuff here. Stuff that will let you replace things like Spotify with Navidrome 548 00:38:07,600 --> 00:38:13,600 and there's all sorts of stuff. But today we're going to focus on audio bookshelf and much like 549 00:38:13,620 --> 00:38:18,200 we did with image linked in the description down below is this docker compose yaml file 550 00:38:18,900 --> 00:38:27,320 i'm going to copy my ts auth key from my image deployment into my audio bookshelf yaml file 551 00:38:27,830 --> 00:38:32,680 now something i didn't point out in the image section is this hostname variable here this is 552 00:38:32,800 --> 00:38:37,360 the name that the container or therefore the service will get when it joins your tail net so 553 00:38:37,700 --> 00:38:42,100 we've got to make sure that that name is something that you want and then also you've got to make 554 00:38:42,100 --> 00:38:48,339 sure that this network mode line is present here. So service and then this name here of service must 555 00:38:48,600 --> 00:38:55,020 match the name of this key I suppose in the YAML file right here. So the syntax needs to look a 556 00:38:55,020 --> 00:39:06,040 little bit like this. You need network mode service colon image audio bookshelf and then everything 557 00:39:06,060 --> 00:39:10,920 will just work just fine because we're not exposing. So one of the concepts of containers that we didn't 558 00:39:10,920 --> 00:39:16,160 get into yet is how it's an encapsulated thing. Nothing's allowed in or out unless you explicitly 559 00:39:16,500 --> 00:39:21,460 define it. So right here we're explicitly defining that this container is allowed to reach out onto 560 00:39:21,460 --> 00:39:28,700 the host system and look for audiobooks for example on mount ssd1 app data. Now we also want to modify 561 00:39:28,880 --> 00:39:34,820 this file path to be ssd1 media for example audiobooks. So you can modify these paths to your heart's 562 00:39:35,080 --> 00:39:39,880 content. I don't really mind where you store anything but the general idea in this scenario 563 00:39:39,900 --> 00:39:46,900 at least is that we're storing the actual data on the second ssd that is called ssd1 confusingly 564 00:39:47,020 --> 00:39:52,300 here but not the primary boot ssd for proxmox we're storing that on like our data drive 565 00:39:53,620 --> 00:39:58,819 we store that there for just a separation of concerns really so much like we did with image 566 00:39:58,920 --> 00:40:03,800 i'm just going to copy this file now using the tailscale extension and then in here i'm going to 567 00:40:04,040 --> 00:40:09,860 create my compose file now you could put this stuff in the same compose file as you did with 568 00:40:09,880 --> 00:40:15,100 image really is personal preference as to how you organize things. You can have one giant 569 00:40:15,320 --> 00:40:20,140 compose file and certainly many people do, myself included, on my server so that I don't have to keep 570 00:40:20,380 --> 00:40:25,720 changing directories to get the correct context into my Docker commands. But I think for the 571 00:40:26,080 --> 00:40:30,580 simplicity of a beginner tutorial, having that switching of context between different applications 572 00:40:31,200 --> 00:40:37,660 might actually be helpful. Okay, so we need to make sure like we did in part one with the image 573 00:40:38,000 --> 00:40:42,300 container that this path actually exists. So I'm going to change to my terminal here 574 00:40:43,040 --> 00:40:50,320 and do the make dir minus p again just to make sure that audiobookshelf tsconfig actually exists. 575 00:40:51,180 --> 00:40:55,200 Then back in my VS Code window I'm going to click this little refresh button up here 576 00:40:55,920 --> 00:41:01,280 and you'll see that tsconfig has now been created. So what I need to do here is copy across again 577 00:41:01,740 --> 00:41:07,640 my reverse proxy configuration. Now audiobookshelf by default runs on port 80 so you can see I've got 578 00:41:07,660 --> 00:41:11,620 AT configured here. That's really the only thing you need to change between different applications. 579 00:41:11,920 --> 00:41:13,760 This audiobookshelf.json 580 00:41:14,000 --> 00:41:16,320 looks exactly the same as image.json 581 00:41:16,820 --> 00:41:18,320 except for the port number. 582 00:41:19,500 --> 00:41:21,720 Okay, so let's get the audiobookshelf.json 583 00:41:22,120 --> 00:41:22,620 copied over. 584 00:41:24,420 --> 00:41:25,320 New file 585 00:41:28,620 --> 00:41:29,580 audiobookshelf.json 586 00:41:30,460 --> 00:41:31,540 Let's open that, 587 00:41:31,920 --> 00:41:35,900 paste that in. And so now we should be good to go. So I'm going to change 588 00:41:36,120 --> 00:41:42,440 out of the image directory by doing cd dot dot to go up a level you can see i'm now in mount ssd1 589 00:41:42,660 --> 00:41:49,259 app data and just to get just to give you a lay of the land i'm going to do l2 to list two levels 590 00:41:49,440 --> 00:41:54,500 deep in the directories so you can see we've got the audio bookshelf directory with a compose file 591 00:41:54,760 --> 00:41:58,940 and we've got the image directory with a compose file image is still running in the background by 592 00:41:58,940 --> 00:42:03,980 the way if i do a docker ps minus a you can see the image is still there running in the background 593 00:42:04,000 --> 00:42:08,820 but we want to do audio bookshelf now so I'm going to change into the audio bookshelf directory 594 00:42:09,590 --> 00:42:13,020 do a docker compose pull that's going to do the same thing again now you'll notice 595 00:42:13,640 --> 00:42:19,400 that the image audio bookshelf container in fact I've just spotted an egregious mistake 596 00:42:21,340 --> 00:42:25,840 this yeah you can tell I copied and pasted this can't you I need to change this from image audio 597 00:42:25,960 --> 00:42:34,460 bookshelf to audio bookshelf ts and then of course how did i not spot that when i was talking to you 598 00:42:34,560 --> 00:42:40,500 a minute ago you're probably screaming at the screen going alex anyway it's done now it's fixed 599 00:42:40,740 --> 00:42:46,979 it's okay we didn't actually create anything um so let's go back paste that into our remote node 600 00:42:47,180 --> 00:42:54,060 and save the file and so now we when we do a docker compose pull it has already pulled the images 601 00:42:54,340 --> 00:43:00,180 we're good to go so we've got the audiobook shelf app and then app minus ts so if we do a docker 602 00:43:00,330 --> 00:43:05,640 compose up again minus d it's going to create those applications for us and then again we do a 603 00:43:05,780 --> 00:43:11,420 logs minus f just to double check that everything's going on and working for us uh just fine beneath 604 00:43:12,020 --> 00:43:17,400 beneath the covers so let's go back to our tailscale admin console and just verify that that 605 00:43:17,560 --> 00:43:22,720 node has been added and created you can see we've now got an audiobooks node on here so i'm going 606 00:43:22,720 --> 00:43:28,180 copy that to my clipboard and paste that in here and all being well we're going to now go out to 607 00:43:28,440 --> 00:43:33,800 let's encrypt and request a certificate with our acme account this will take just a moment or two 608 00:43:38,940 --> 00:43:43,460 and voila we now have our audiobook server on our tail net so i'm going to create my username here 609 00:43:43,720 --> 00:43:48,140 again of zafod just create a random junk username and password and click submit 610 00:43:49,120 --> 00:43:51,620 Okay, let's get logged in with Zaford. 611 00:43:52,720 --> 00:43:54,879 So now it's time to create our first library. 612 00:43:55,180 --> 00:43:57,259 Now, let's look back at the Docker Compose file 613 00:43:57,260 --> 00:43:59,220 and kind of explain the anatomy a little bit 614 00:43:59,550 --> 00:44:01,980 of a Docker Compose creation command. 615 00:44:02,700 --> 00:44:04,680 There are several volumes defined here, 616 00:44:05,100 --> 00:44:07,740 and it might be confusing if you've never seen this before 617 00:44:08,020 --> 00:44:08,700 as to what's going on. 618 00:44:09,440 --> 00:44:11,040 This is the path that actually exists 619 00:44:11,190 --> 00:44:14,000 on the physical Dell host, not inside the container. 620 00:44:14,220 --> 00:44:16,620 So you can think of this thing before the colon 621 00:44:16,640 --> 00:44:22,540 as being the external point of data, where it exists on the host. 622 00:44:23,420 --> 00:44:25,900 You then want to think about, after the colon here, 623 00:44:26,300 --> 00:44:29,400 of slash audiobooks being inside the container. 624 00:44:29,820 --> 00:44:31,360 And indeed, we can see that now. 625 00:44:31,380 --> 00:44:36,040 If we go to add your first library, I'm just going to call this one audiobooks, 626 00:44:36,140 --> 00:44:37,700 and I click on Browse for Folder, 627 00:44:38,260 --> 00:44:42,260 you can see that audiobooks exists inside the container, slash audiobooks. 628 00:44:42,620 --> 00:44:44,859 If I click Select Folder Path and Create, 629 00:44:45,640 --> 00:44:47,440 We've now got an empty library. 630 00:44:47,960 --> 00:44:52,720 And if I click on the scan button, it's now going to scan for books inside that library. 631 00:44:53,340 --> 00:44:57,500 And we can see that George Orwell Animal Farm indeed now exists. 632 00:44:57,920 --> 00:45:00,300 Animal Farm by George Orwell. 633 00:45:00,700 --> 00:45:01,259 Fantastic. 634 00:45:01,700 --> 00:45:01,839 Okay. 635 00:45:02,700 --> 00:45:09,799 So what we haven't done yet is we haven't connected up our phone to either image or audio bookshelf. 636 00:45:10,220 --> 00:45:13,680 And I think that's a really important part of this entire solution. 637 00:45:13,740 --> 00:45:17,939 So I'm going to put this under a new chapter down below, so I'll be right back. 638 00:45:18,740 --> 00:45:23,740 So one of the entire points of this tutorial series is to show you that with self-hosting and Tailscale, 639 00:45:24,360 --> 00:45:27,480 you can access your self-hosted services from anywhere. 640 00:45:27,900 --> 00:45:30,500 No firewalls, no complicated configuration or anything like that. 641 00:45:31,140 --> 00:45:34,859 So it's time to grab your phone and go to the App Store of your choice. 642 00:45:35,060 --> 00:45:39,020 We have apps for iOS, for Android and many other platforms too. 643 00:45:39,780 --> 00:45:43,600 I'm just going to search for Tailscale in the App Store here and download it to my phone. 644 00:45:44,120 --> 00:45:50,420 whilst I'm here I'm also going to search for the image app and download that one too along with 645 00:45:50,730 --> 00:45:57,460 an app called plapper there are several different audiobook clients for audiobook shelf for ios 646 00:45:57,720 --> 00:46:00,899 plappers one shelf player is another one you can see that one just a little bit below it 647 00:46:01,410 --> 00:46:09,339 um I think there might also be an audiobook shelf app but I think it's only in um test flight mode 648 00:46:09,500 --> 00:46:10,900 So let's just double check that. 649 00:46:13,960 --> 00:46:16,320 Yeah, I've definitely seen it at some point, 650 00:46:16,320 --> 00:46:17,920 but I think it's only available in TestFlight, 651 00:46:18,080 --> 00:46:20,200 and honestly, it could use some more work. 652 00:46:20,280 --> 00:46:20,920 But if you're on Android, 653 00:46:21,110 --> 00:46:23,820 the official audio bookshelf app actually works pretty well. 654 00:46:24,680 --> 00:46:25,859 So we've got Plapper. 655 00:46:26,790 --> 00:46:27,800 Where do these names come from? 656 00:46:29,640 --> 00:46:30,859 I'm going to put that on my home screen. 657 00:46:31,480 --> 00:46:33,780 I'm going to get Image and put that on my home screen. 658 00:46:35,360 --> 00:46:37,840 And then also Tailscale 2. 659 00:46:37,960 --> 00:46:44,280 So I'm going to go ahead and connect this device to my tail net in order that I can access these different services remotely. 660 00:46:44,740 --> 00:46:47,379 I'm going to go through and click all of the sort of entry wizard. 661 00:46:47,580 --> 00:46:49,560 I'm going to install VPN configuration. 662 00:46:50,940 --> 00:46:52,620 Yes, it's going to ask me for my passcode. 663 00:46:53,940 --> 00:46:55,180 And then it wants to get logged in. 664 00:46:55,300 --> 00:46:58,920 Now I'm going to use my Google account, the same account that I logged in with my laptop. 665 00:46:59,520 --> 00:47:01,800 And I've just logged these two different services in as well. 666 00:47:02,540 --> 00:47:06,700 I'll have a tail and scales at gmail.com and then connect this device to my tail net. 667 00:47:06,780 --> 00:47:13,640 So you will see now on the screen, look, I've got image, I've got audiobooks, and if I wanted to, I could just access these things in the browser. 668 00:47:14,130 --> 00:47:20,700 I could literally go to Safari and put this in here, and it will just work. 669 00:47:21,440 --> 00:47:27,640 But Image has some nice features when you get to iOS, like automatic backup of pictures you take and things like that. 670 00:47:27,690 --> 00:47:29,000 So let's use the application. 671 00:47:29,620 --> 00:47:36,720 I'm going to install the or allow notifications, paste in the URL for image here into the client, 672 00:47:37,260 --> 00:47:42,900 get logged in with, what did I put, a tail and scales at gmail.com and then I'm going to allow 673 00:47:43,060 --> 00:47:50,020 it full access to my photos. So this icon up here in the top right allows me to back up pictures 674 00:47:50,110 --> 00:47:56,280 that I take. So let's click on recents and for example and now if I click start backup it's going 675 00:47:56,280 --> 00:48:00,900 to start uploading things from this phone like screen recordings and all sorts of other stuff 676 00:48:01,780 --> 00:48:05,380 you can see that photos i took on this phone are now automatically uploaded in fact let's 677 00:48:05,880 --> 00:48:13,340 let's take one in real time and see sort of what happens here we go bink all right so going back 678 00:48:13,560 --> 00:48:23,640 to the image application i'm just going to quit this thing and reopen it and do a i think you can 679 00:48:23,660 --> 00:48:28,200 start a manual backup each time or you can have it automatically backup photos when you're charging 680 00:48:28,620 --> 00:48:32,540 much like google photos within the background there you go there's the picture i just took 681 00:48:34,420 --> 00:48:38,560 so in real time you know i've been able to you can see i'm cheating using 682 00:48:39,270 --> 00:48:44,420 claw down the bottom there look for some commands but you can see really just how easy it is to 683 00:48:44,560 --> 00:48:49,859 replace some of the hosted services so for example image now is pretty much in a position to 684 00:48:49,880 --> 00:48:56,040 completely replace google photos for me all right so that's that's image what about audiobooks now 685 00:48:56,040 --> 00:49:01,160 we want to put in the fully qualified domain name for audio bookshelf and to save me a bunch of 686 00:49:01,340 --> 00:49:06,980 typing on the phone i'm going to go back to the tailscale app copy the magic dns name and put that 687 00:49:07,140 --> 00:49:12,660 into the audio bookshelf piece right here what username i think i set xafod didn't i 688 00:49:12,660 --> 00:49:13,000 let's 689 00:49:13,000 --> 00:49:13,220 do 690 00:49:13,240 --> 00:49:21,200 Zaphod and then just the username and password this way. On all being well I should now be able 691 00:49:21,200 --> 00:49:27,500 to see my Animal Farm audiobook. Great, logged in now so I'm going to click on the audiobooks and 692 00:49:28,020 --> 00:49:35,620 just like that I'm able to listen to Animal Farm by George Orwell narrated by Stephen Fry. 693 00:49:36,740 --> 00:49:42,220 And then I can download the books, okay I didn't know this but there is a small fee to unlock 694 00:49:42,720 --> 00:49:45,720 features like downloading audiobooks for offline listening and all that kind of stuff 695 00:49:46,160 --> 00:49:50,600 supporting the developer i have no problem with that but you can you can generally get the idea 696 00:49:50,900 --> 00:49:56,400 here that this this is a way to replace audible okay so we've replaced google photos we've 697 00:49:56,520 --> 00:50:03,660 replaced audible and they're both now on my phone so you know two services are really very very 698 00:50:03,840 --> 00:50:10,180 useful in my life i've now replaced with self-hosting now what about home automation we can come on to 699 00:50:10,180 --> 00:50:15,419 Home Assistant next. You see this one up here? This is hiding, it's ready, but we need to actually 700 00:50:15,680 --> 00:50:19,899 deploy Home Assistant. This is a bit different how we do this one. We're not going to do this with a 701 00:50:20,160 --> 00:50:25,540 container. We're going to do this using the helper scripts from helperscripts.com on top of Proxmox. 702 00:50:26,440 --> 00:50:31,880 Home Assistant is one of those projects that if you haven't heard of it, you absolutely should 703 00:50:32,140 --> 00:50:37,120 give it a look. I'm sure at some point you've gone to Best Buy or something like that and bought 704 00:50:37,580 --> 00:50:44,200 a smart product like a hue light bulb or some kind of internet connected thing and then each of those 705 00:50:44,300 --> 00:50:50,440 things comes with their own app and so you end up having 15 different apps on your phone one to open 706 00:50:50,440 --> 00:50:56,500 your garage door and one to turn the lights on and it's just a mess well home assistant pulls all of 707 00:50:56,620 --> 00:51:04,380 those different ecosystems together into one place and puts it as a local control with privacy first 708 00:51:04,720 --> 00:51:09,819 smart home system. The really cool thing about that is you can then have those disparate ecosystems 709 00:51:10,540 --> 00:51:14,580 triggering each other. So when you turn on the light bulb in the kitchen, for example, 710 00:51:14,760 --> 00:51:20,660 you could have it turn on or close your smart shade in your bedroom if you want to. I don't 711 00:51:20,660 --> 00:51:25,899 know why you would do that specific example, but it could be really useful to have all these 712 00:51:25,980 --> 00:51:30,620 different things be able to trigger each other. So let's dig into how we actually go ahead and 713 00:51:30,800 --> 00:51:36,440 deploy home assistant now in this epic beginner's guide to self-hosting video so i'm going to go 714 00:51:36,440 --> 00:51:41,380 back to my old friends over at helper scripts and i'm going to search for home assistant we're going 715 00:51:41,440 --> 00:51:47,020 to deploy home assistant os as a vm and then i'm just going to copy this string here this how to 716 00:51:47,240 --> 00:51:52,100 install option here i'm going to go back to my proxmox box and then just copy and paste this 717 00:51:52,330 --> 00:51:56,840 into the shell this is going to take us through a little wizard and rather than creating home 718 00:51:56,860 --> 00:52:02,360 assistant as a container or anything else like that we're going to do it as a vm because home 719 00:52:02,560 --> 00:52:08,000 assistant os is this fully encapsulated thing for home assistant it contains all of the dependencies 720 00:52:08,210 --> 00:52:15,000 and it's it's its own kind of little world for home assistant um yeah it's just the easiest way 721 00:52:15,000 --> 00:52:19,780 to go i think particularly for beginners so let's go through the wizard and we're going to go through 722 00:52:19,830 --> 00:52:26,819 the advanced options just to see what's open to us stable version yes that sounds good virtual 723 00:52:26,840 --> 00:52:32,880 id 100 would probably be fine but i'm going to set 333 just i don't actually know why 724 00:52:34,720 --> 00:52:41,379 i440x right through cache yeah fine oh host name i'm going to set to home assistant 725 00:52:42,400 --> 00:52:49,240 and then we're going to do host cpu yep that's fine our little dell box has four cpu cores so 726 00:52:49,240 --> 00:52:56,280 i'm going to set that for ram i'm going to do 8192 for eight gigabytes vm bridge zero is fine the 727 00:52:56,280 --> 00:53:02,280 MAC address is fine, the VLAN is fine, the MTU is also fine. Start VM when completed, yes, and ready 728 00:53:02,300 --> 00:53:07,260 to create, yes. So now the script's going to go through and create the virtual machine for us. 729 00:53:08,400 --> 00:53:11,880 We'll do a couple of things once it's created. We're going to attach it to our tail net and then 730 00:53:11,940 --> 00:53:17,140 also install a certificate so that you can access it from your phone, of course. That's been the 731 00:53:17,340 --> 00:53:22,000 theme of this video, I know, but we've done it with containers thus far, and one of the reasons I 732 00:53:22,040 --> 00:53:26,040 wanted to show Home Assistant here is because, well first of all, it's a really cool application. 733 00:53:26,100 --> 00:53:31,759 It's one of those ones that make you feel like you're solving real problems in the real world with self-hosted software. 734 00:53:32,320 --> 00:53:36,840 And for me, that's where when you start connecting those real problems with real solutions, 735 00:53:37,620 --> 00:53:41,819 that's where the magic of self-hosting really starts to come alive. 736 00:53:42,160 --> 00:53:45,460 So we can see here that the VM has now been created. 737 00:53:46,180 --> 00:53:47,879 It's going to boot up for the very first time. 738 00:53:48,120 --> 00:53:50,880 Let's wait and see what IP address we get. 739 00:53:51,480 --> 00:53:55,740 You can see, by the way, that a virtual machine is basically just emulating a small computer 740 00:53:56,280 --> 00:53:57,760 with inside your little Dell box. 741 00:53:58,480 --> 00:54:02,260 So it's emulating memory, it's emulating a processor stack, a disk stack, 742 00:54:02,400 --> 00:54:07,420 it's pretending it's got a real screen, a real SCSI control, all this stuff. 743 00:54:07,420 --> 00:54:08,300 It doesn't actually matter. 744 00:54:09,100 --> 00:54:11,720 But if you want to view the console of the output of that machine, 745 00:54:11,870 --> 00:54:15,279 you select the virtual machine in the Proxmox web interface, 746 00:54:16,100 --> 00:54:19,240 which, by the way, why am I not on my little PVE? 747 00:54:20,480 --> 00:54:22,000 Alex, Alex, Alex, Alex. 748 00:54:23,980 --> 00:54:24,340 Here we go. 749 00:54:24,830 --> 00:54:29,040 I should be using my little PVE thing with Tailscale serve, shouldn't I? 750 00:54:29,560 --> 00:54:31,120 All right, so let's go Home Assistant console, 751 00:54:31,410 --> 00:54:36,640 and we've got now an IP address of 192.168.1.118, 752 00:54:37,240 --> 00:54:40,080 and then Home Assistant runs on port 8123. 753 00:54:41,020 --> 00:54:43,140 This initial setup can take a minute or two. 754 00:54:43,320 --> 00:54:46,840 It's doing things like expanding the disk, downloading any containers, 755 00:54:47,280 --> 00:54:49,720 and just instantiating itself, just creating itself, 756 00:54:49,940 --> 00:54:51,560 getting itself ready to go. 757 00:54:52,220 --> 00:54:54,419 So when that's complete, we'll be back in a minute. 758 00:54:55,160 --> 00:54:57,319 Okay, the initial installation is complete. 759 00:54:58,060 --> 00:54:59,740 I'm now going to create my smart home, 760 00:55:00,060 --> 00:55:01,980 tailscale towers, sure, why not? 761 00:55:02,600 --> 00:55:03,700 Username of Zaphod, 762 00:55:03,940 --> 00:55:06,220 let's just create a random junk username and password, 763 00:55:07,000 --> 00:55:08,480 create account, fantastic. 764 00:55:10,020 --> 00:55:11,440 Location, doesn't really matter. 765 00:55:12,120 --> 00:55:13,940 In this example, you can of course go ahead 766 00:55:13,940 --> 00:55:15,820 and configure this however you would like. 767 00:55:16,440 --> 00:55:17,360 But you can see already, 768 00:55:17,540 --> 00:55:23,820 this is one of the absolute magical things about Home Assistant. It's already detected all of these 769 00:55:23,940 --> 00:55:30,240 different compatible devices on my network. So my Android TV, my Apple TVs, Ecobee thermostats. 770 00:55:31,200 --> 00:55:38,460 It's just amazing. Absolutely amazing. And out of the box, it gives you a very best approximation 771 00:55:38,940 --> 00:55:43,520 of like a dashboard you might want. Like I can already control the light that's up here, for 772 00:55:43,520 --> 00:55:49,620 example as part of my filming setup directly from home system with no additional configuration 773 00:55:50,500 --> 00:55:58,660 how cool is that all right enough fanboying out of the way with with home assistant it's time to 774 00:55:58,660 --> 00:56:03,620 actually get this thing on our tail net so let's go down to settings let's crack on and install an 775 00:56:03,780 --> 00:56:10,280 add-on or two first of all we're going to want to install the tail scale add-on so just a case of 776 00:56:10,280 --> 00:56:15,420 clicking install here and then we're also going to want to install the studio code server add-on 777 00:56:15,880 --> 00:56:21,480 and this will become clear in just a moment as to why we want to do that too okay so let's go back 778 00:56:21,560 --> 00:56:28,640 to settings and add-ons once more and we're going to start up the tailscale container i say container 779 00:56:28,880 --> 00:56:33,840 add-on it is really just a container under the hood it's all just docker masquerading but um 780 00:56:34,720 --> 00:56:38,759 now there is an option in fact i did a tutorial which i'll put a link to up here about you can 781 00:56:38,760 --> 00:56:43,180 click on open web UI and get logged into tail net but for me for some reason it's not working 782 00:56:43,880 --> 00:56:50,060 so to get around this we can go into the logs of the container and click on this little URL here 783 00:56:50,920 --> 00:56:55,660 and authenticate to our tail net that way so little work around I'm not sure why it's it's 784 00:56:55,660 --> 00:56:59,540 not working I'll file a bug for that internally and hopefully we get that fixed by the time this 785 00:56:59,600 --> 00:57:04,720 video comes out so I'm going to click on connect and then visit console and you can see that my 786 00:57:04,740 --> 00:57:10,759 Home Assistant now exists in my tail net so if I want to connect to this instance I can do 8123 787 00:57:11,860 --> 00:57:16,240 and I can now connect to Home Assistant from anywhere in the world that I'm connected to 788 00:57:16,380 --> 00:57:22,880 Tailscale but you know me I like to have full-on TLS certificates wherever possible so this is where 789 00:57:23,100 --> 00:57:29,319 the studio code option comes in so let's go back to the documentation section of the Tailscale 790 00:57:29,340 --> 00:57:34,900 community add-on which by the way is maintained by frank who seems to be like the most prolific 791 00:57:35,700 --> 00:57:39,779 home assistant uh developer going when it comes to all the add-ons he does the tail scale add-on 792 00:57:39,810 --> 00:57:45,660 he does the the code the code studio add-on anyway he's a good dude um so let's go to 793 00:57:45,970 --> 00:57:51,919 documentation and scroll all the way down to where it starts talking about proxy the home assistant 794 00:57:52,120 --> 00:57:58,420 add-on calls it proxy we call it tail scale serve so those two things are the same i don't know why 795 00:57:58,420 --> 00:58:04,980 it's called proxy in the home assistant add-on c'est la vie i guess okay so we're going to copy 796 00:58:05,010 --> 00:58:11,500 these four lines onto our clipboard and then we're going to go to our add-ons page again and start 797 00:58:11,570 --> 00:58:17,880 the studio code add-on i'm going to click show inside bar and so take just a minute to start up 798 00:58:18,390 --> 00:58:23,420 now we could click on open web ui but i i've already clicked the show inside bar button so it 799 00:58:23,560 --> 00:58:27,779 shows up here for all time because it's really handy to have this little studio code server 800 00:58:27,800 --> 00:58:32,840 available as part of Home Assistant. You can see we're basically just loaded now into VS Code but 801 00:58:32,850 --> 00:58:38,500 in a browser. So look for this file here configuration.yaml and paste in those four lines 802 00:58:38,710 --> 00:58:43,100 from your clipboard and then because you're in a browser some of the keyboard things don't pass 803 00:58:43,130 --> 00:58:48,800 through correctly so file save manually just to make sure that this file does actually get saved. 804 00:58:49,340 --> 00:58:52,340 go to settings and then restart home assistant 805 00:58:54,860 --> 00:58:58,920 this will take maybe 10 or 15 seconds on the completely fresh install 806 00:58:59,400 --> 00:59:05,380 on a more mature install it could take a minute or two depending on how many add-ons you've got 807 00:59:05,380 --> 00:59:10,000 and that kind of thing but once it's back up and running you want to go back to add-ons and then 808 00:59:10,140 --> 00:59:16,319 tail scale and then configuration click on show unused optional configurations and look for 809 00:59:16,520 --> 00:59:22,680 tailscale proxy check the box click save the tailscale add-on is going to have to restart 810 00:59:23,000 --> 00:59:29,080 yes that's fine go ahead and do that and then we want to look in the logs for all of the acme 811 00:59:29,380 --> 00:59:35,500 requests for the tls certificate in fact there we go this is now available within your tailnet on 812 00:59:35,700 --> 00:59:42,640 this url right here so all being well home assistant still restarting of course but the 813 00:59:43,440 --> 00:59:48,460 actual add-on is doing exactly what we wanted it to do. You can see we've got a full HTTPS 814 00:59:48,660 --> 00:59:54,120 certificate at homeassistant.phelociraptor-noodlefish and we are now good to go. 815 00:59:55,940 --> 01:00:02,260 Get logged in with my username and password and voila I can now access this from anywhere on my 816 01:00:02,500 --> 01:00:09,960 tail net. So let's do that let's control this light on my desk in front of me over tail scale 817 01:00:10,220 --> 01:00:16,419 over 5G. So let's turn the Wi-Fi off on my phone. Let's load up Home Assistant. In fact, I'm going 818 01:00:16,420 --> 01:00:20,720 to load up Tailscale once more because I hate typing. And then I'm going to go to Home Assistant, 819 01:00:21,080 --> 01:00:26,720 copy this URL right here, I suppose the DNS name. I'm going to go into the Home Assistant 820 01:00:27,000 --> 01:00:32,720 application. I'm going to enter my address manually and paste that from my clipboard. 821 01:00:34,120 --> 01:00:39,380 I want HTTPS. Yes, thank you, Home Assistant. I'm going to connect to that. It's going to ask me to 822 01:00:39,380 --> 01:00:48,860 log in which I will dutifully do and now but by the way I'm on 5G so I'm not I'm not on the same 823 01:00:49,080 --> 01:00:54,480 network as this which means I could literally be anywhere in the world I know I've belabored that 824 01:00:54,620 --> 01:01:01,920 point but tailscale is amazing sometimes and just simply by pressing the button on my phone over 5G 825 01:01:02,400 --> 01:01:08,000 with home assistant in what I've been filming this segment for 13 minutes I'm sure in the edit it'll 826 01:01:08,020 --> 01:01:13,160 be a little bit less but we've just set up home assistant and that's it that is the magic of 827 01:01:13,280 --> 01:01:19,300 tailscale right there the magic of self-hosting and tailscale i suppose actually so what have we 828 01:01:19,300 --> 01:01:25,640 done today we have set up a google photos replacement we have set up an audible audiobooks 829 01:01:25,940 --> 01:01:31,180 server replacement we have started you down the journey of open source self-hosted privacy 830 01:01:31,580 --> 01:01:37,180 respecting home automation and we've connected all those things using our phone over 5g using 831 01:01:37,200 --> 01:01:42,060 in Tailscale, we haven't configured a single firewall rule. We're not paying for any subscriptions 832 01:01:42,360 --> 01:01:46,740 for any of this stuff. Tailscale is completely free for home users, remember, 100 devices 833 01:01:47,220 --> 01:01:53,279 and three users for free. And a device, by the way, counts as these. So we've used five devices today 834 01:01:53,740 --> 01:01:58,100 towards our 100 device limit. But if you share Tailscale with friends and family, you can add 835 01:01:58,200 --> 01:02:01,879 two devices to that free limit every time you refer someone to Tailscale as well. 836 01:02:02,880 --> 01:02:06,460 So I know that was a super long, epic two-part series 837 01:02:06,670 --> 01:02:08,220 on how to get started with self-hosting. 838 01:02:08,500 --> 01:02:10,780 If you have any questions about anything you've seen 839 01:02:10,850 --> 01:02:13,220 in today's video, I'll be doing some live streams 840 01:02:13,450 --> 01:02:15,220 over the next month or two where you can come 841 01:02:15,360 --> 01:02:16,600 and ask me questions directly. 842 01:02:17,100 --> 01:02:18,920 Or indeed, you can just leave a comment down below 843 01:02:19,160 --> 01:02:20,899 with a question and I'll do my best to reply 844 01:02:21,500 --> 01:02:24,680 or even put that into some kind of like an ask tail scale 845 01:02:24,860 --> 01:02:26,180 like video at some point in the future. 846 01:02:26,190 --> 01:02:27,360 I should probably do one of those. 847 01:02:28,900 --> 01:02:30,560 But yeah, super long video. 848 01:02:30,730 --> 01:02:32,480 If you've made it to the end, thank you. 849 01:02:32,720 --> 01:02:35,000 Please leave a comment down below with the word bananas. 850 01:02:37,180 --> 01:02:39,600 And until next time, I've been Alex from Tailscale.