It's time for part two in our complete beginner's guide to self-hosting.
My name's Alex and I'm from Tailscale.
In part one, I showed you how to install Proxmox, a hypervisor OS,
onto this little Dell small form factor PC.
I'll put a link to that video up here.
In today's video, though, I'm going to show you how to get started installing a bunch of applications.
Image to replace Google Photos, Audio Bookshelf to replace Audible,
and then Home Assistant to get started with self-hosted,
privacy-respecting, open-source home automation.
I'll also show you how to access all of those things from wherever you are in the world on your phone over 5G
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
So that's what we're going to do in today's video
We're going to show you how to install a bunch of applications and get started with self-hosting and tail scale
Okay, so let's pick things up exactly where we left them a couple of weeks ago
This is a completely fresh proxmox install
I'm connected to the, essentially I'm using JetKVM here as if it's a keyboard, monitor and mouse
physically plugged into the device to record the screen so I can show you on video. This is exactly
the same as if you had literally those physical things on the table in front of you, except I can
see it in a web browser. So you can see here, when we boot into Proxmox for the first time,
we get a IP address. Now IP address, you can kind of think about a little bit analogous to like an
an apartment building, for example, like the address of an apartment building.
And then the port number, which here is denoted by 8006,
that's the apartment within the building.
So you've got the apartment building of 192.168.1.10,
and then the apartment or the service that we want to access within that building
running on port 8006.
So what we do with that information is we take this string here
and we type it into our web browser over here.
So we do HTTPS colon slash slash 192.168.1.10 colon 8006.
We'll probably get the scary, this is an HTTPS self-signed certificate,
the world is about to end, error.
Don't worry about that, it's fine.
You can just click through.
We're going to deal with how to get rid of that error in the next section,
or this section technically I suppose,
because what we're going to do first is installing TailScale.
I've got like a little cheat sheet here,
which I'll probably put this document into the GitHub repo.
All of my videos have code snippets,
well, most of them have code snippets,
and like a running order of what's going on.
So I'm going to put this script, this document,
into the GitHub repo,
which will be linked in the description down below.
And as best as I can manage,
I'm not going to edit each chapter,
because there'll be chapters in the description.
So you can skip to the part of the video that you want.
So to start with,
we're going to talk about installing TailScale
and how to set up Tailscale SSH.
We should probably talk about also setting up a TLS certificate using
serve
so that we don't have to worry about a reverse proxy.
We'll come on to all that stuff later.
Then we'll install Docker.
We're going to partition our data disks, install image.
Right, there's a lot to do today.
So it's going to be quite a long video, hence make liberal use of the chapters.
Okay.
So we want to get logged in now to our Proxmox installation
using my username and password i think i actually set a different password i do actually by the way
have a video on how to you can probably find that up here on how to configure proxmox to log in using
your tailscale identity instead of a username and password but we're in that kind of classic
chicken and egg problem right now where we don't have tailscale installed on the node so we can't
use it for like this also this is a beginner's guide and that you know replacing authentication
is probably step seven, maybe even step 17, and we're on step one here. So just get logged in
with the username and password and you should be all good. Now that little subscription nag there,
back when I was a Proxmox junior, several years ago now, I thought that meant you had to pay for
Proxmox. Don't worry, it's completely free. That little subscription nag is only there to remind
you to contribute to the Upstream project should you wish to. You don't have to pay them a single
penny. Now in order to make that subscription nag and everything else like go away properly, I think
I showed you this in part one but just a quick recap, you can go to helperscripts.com and search
for post install and then you can run this little script against your Proxmox server by taking it
onto your clipboard, copying it and going to the node, clicking on shell and this is giving you a
command line interface effectively like a remote shell to control that remote Proxmox instance
You can then copy and paste it onto the terminal and go through.
So I'm going to start the install script.
Yes.
I'm going to correct my sources.
Yep, yep, yep, yep.
Disable.
Yep.
Enable high availability.
No.
This time I made a mistake in the last video, which so many of you lovely people pointed out.
Do I want to update it now?
No.
Do I want to reboot now?
No.
So what I'm going to do is do an apt update.
And then the next thing that Proxmox, we should do, because it's been a couple of weeks since I touched this system, actually,
is we're going to run PVE upgrades.
Typically what you would do is apt upgrade with a Debian system,
which is of course what Proxmox is based on.
But the Proxmox project recommend that you use PVE upgrade.
There's some Proxmox specific stuff it does in the background.
You can see we're going to get a new kernel,
we're going to get a whole bunch of new packages.
And essentially it's just good practice to make sure that your box is up to date
before you start doing anything else.
So this will take a couple of minutes.
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.
So see you shortly.
Okay, and we're back.
I went ahead and rebooted the node after the packages had all installed because we've got a new kernel.
I followed that process over here in JetKVM.
But now if I refresh this page, we are back and we are good to go.
So what do we need to do now?
We want to install TailScale for a couple of reasons. First of all, I don't want to be managing
SSH keys. Like in this directory here, you can see authorized keys. There's nothing in that file. So
I'm probably jumping ahead here. What is an SSH key, Alex? Okay. So typically when you're
authenticating with SSH to a remote server, there has to be some kind of way for you to prove you
are who you say you are. And typically we do that either with a username and password, or we do that
with something called an SSH key. This uses the PKI, the public key infrastructure, kind of concepts
of Alice and Bob to make a key really easy to reverse engineer in one direction, but hard to
work out in the other direction. So the public and private key pairs come together to basically
prove that I am who I say I am. But that means you have to manage SSH keys, which let's be honest,
is, if you're familiar with the topic, it's kind of a pain. But with Tailscale SSH, there are no
usernames, well there are usernames, there are no passwords, there are no SSH keys or anything like
that. So first of all, that's why I want to get Tailscale on here. Secondly is I want to use
Tailscale serve so that we don't have to worry about this pesky insecure message at the top here
as well. And then of course, if this is a node on my tail net, then of course I can access any of
the services running on this box from anywhere I like, such as my phone when I take a picture
and have it upload to my Google Photos self-hosted clone, for example.
So let's head over to tailscale.com slash download.
We're going to get the Linux install script from here.
We're going to copy that onto our clipboard,
go back to Proxmox and paste that in just here.
This will take 10, 15 seconds to install.
So now we need to log in and create this node or add this node to our tail net.
So we want to go to tailscale.com, no download this time.
And in the top right-hand corner, if you don't already have a Tailnet,
you can click on this button, get started, it's free.
There are 100 devices and three users for free.
And we've made a commitment that this will always be free as well.
So you don't need to worry about rug pulls and all that kind of stuff in the future.
I already have a Tailnet, of course, you know, might be biased,
but I want to click on my admin console just here.
And then you can see that actually this is a demo instance of PVE,
so I'm going to delete that.
But you can see I've literally only got two devices in my tail net right now.
This laptop that I'm connected from, Baldrick,
and the other one is my gaming rig downstairs
as I like to stream video games sometimes over tail scale
using Artemis and Moonlight Sunshine, all that stuff.
I've got a video coming on that soon,
so get subscribed, you know, like, comment, subscribe, all that good stuff.
So now we are logged in in the browser.
Let's go back to Proxmox and we're going to do tailscaleup-dash, two dashes is important, SSH.
This is going to give us a URL which we're going to copy onto our clipboard and paste into the browser.
It's then going to ask me to authenticate to my tailscale account,
which in this case my authentication is done through Gmail.
That bit's not important.
Obviously you can use whatever auth provider you like when you set up your tailnet,
but I just found Gmail the most convenient for these tutorials.
And if we click now on visit console, you'll see that I have the PVE node is now on my
tail net.
So time for the big reveal, so far as SSH is concerned, at least.
I'm now going to do SSH root at PVE.
And that name, that string, by the way, must match the name that is specified here.
So I could do the IP address if I want to.
I could do the fully qualified host name of Velociraptor-Noodlefish.
Or I can just do the node name itself, which is what I'm going to do here.
So ssh root at PVE, no usernames, no passwords, no SSH keys, and I'm logged in to my Proxmox
instance.
Come on, that's pretty cool.
So now we want to get rid of the self-signed TLS certificate.
Now there are two ways we can do this actually.
If we look in Google for Tailscale Proxmox, we have an article on Tailscale on a Proxmox
host.
And there are two things we can do.
One of them is to enable HTTP access from the Proxmox web UI is run this little script here.
We can generate a TailScale certificate and install it into the Proxmox, I guess, key store, certificate store.
Or we can just press easy mode and use TailScale serve.
So guess what I'm going to do?
I'm going to do easy mode.
I'm going to do sudo TailScale serve.
Go back to my instance.
Copy that and put that on the clipboard.
Pseudo is not found.
Well, I'm root anyway, so it doesn't matter.
Pseudo, by the way, elevates your privileges if you're not familiar with what Pseudo does.
It takes you from being like a standard user, so like Alex, and turns you into a super user,
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
can actually access with a TLS certificate. So if I have this domain name here of PVE Velociraptor,
if I copy that onto my clipboard, now this will take 10, 15, 20 seconds the first time
because Tailscale now on the back end is reaching out to a certificate provider called Let's Encrypt
which is completely free and generating you a TLS or an HTTPS certificate, an encryption certificate.
And there you go. In real time there were no cuts or edits there. You can see that I'm now accessing
my Proxmox installation over Tailscale with a certificate. Now a couple of important things I
want to point out. This address is only available within your tail net. Tailscale also offer a
product called Tailscale Serve. I say product, it makes it sound like it costs money. It doesn't,
it's free, it's on the free tier. But Tailscale Funnel does the exact same thing as Serve,
except it makes it available on the public internet. Now, please don't go and put your
Proxmox server on the public internet. It's just not a good idea for many, many reasons.
Just don't do it.
But if you have an application you want to share with friends and family
who aren't using Tailscale for some reason,
or you want to share a prototype of a website you're working on
or a project you have hosted locally with somebody from your laptop or whatever,
Tailscale Funnel is designed and works really well for that use case.
It's not very well suited to long-running use cases
like hosting stuff like a Proxmox interface or something like that.
So anyway, back to the point.
Tailscale serve makes this interface of the Proxmox UI available within your tail net.
So now anywhere you are connected to Tailscale,
you can also now connect to your Proxmox instance using this fully qualified domain name.
Now I use that phrase quite a lot.
You might see FQDN in a lot of stuff.
That's what it means.
The fully qualified domain name here of velociraptor-noodelfish.ts.net,
that's the fully qualified domain name.
Now a couple of things I didn't mention which I probably should do before we get off this topic.
Under DNS you've got to make sure that you have a tail net name so by default out of the box
all tail nets come with this kind of like placeholder name it's not memorable it's a
little bit ugly but you get it for free. You also get a real name for free of something with a tail
and something with scales if you roll the dice and come up with a unique name for your tail net too
So go ahead and make that change there.
In order to actually utilize the DNS name and the HTTPS certificates as well,
on a fresh tail net at least,
you'll need to make sure that Magic DNS is turned on
and the HTTPS certificates are turned on as well.
So with that done, that's the basics of configuring tail scale on Proxmox.
The next thing we want to do is go ahead and install Docker.
So I'm going to go over to get.docker.com
and just copy the first little bit of this script right here.
I'm not going to worry about the O install Docker part.
I'm going to paste that into my clipboard, do a pipe to SH,
and this is going to install Docker on my Proxmox host.
Now, Docker, you've probably heard of this.
It's a containerization engine that lets you run containerized applications on Proxmox.
Now, there are a lot of different schools of thought, shall I say,
as to whether you should install things directly on the Proxmox host, or create virtual machines and put things in virtual machines,
or create what are called LXC containers, or LX containers, because the C already means containers.
Anyway, to be honest with you though, this is a beginner's guide, okay?
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.
So for today, we're going to put everything on the Proxmox host itself.
We're not going to do any VMs.
We're not going to do any LXCs.
But what we are going to do is we are going to use Docker Compose to declaratively declare
what all of our containers look like on the Proxmox host with a text file.
So with Docker install, we're going to do docker run dash dash rm it hello world just to prove
that Docker is actually working.
And hello from Docker.
This message shows that your installation appears to be working correctly.
Hooray!
Okay, so I'm looking at my little list here.
The only thing we've got left to do now is partition our disk.
So how do we do that?
Our data disk.
Now remember when I showed you in part one the hardware for this thing?
There are two disks in this system.
The first one is a NVMe SSD.
So that's this one up here.
and this is a Samsung 980 500 gigabyte NVMe SSD.
This is where Proxmox is installed to.
This is where your Docker containers will be running
but we want to make sure that their data persists somewhere else
such that we can back it up later
and again, this is a beginner's guide.
We will probably come on to backups in a future part
although I'm not promising anything to be part of this series.
I think a dedicated video on data backups over Tailskate
is probably warranted
but what we want to do is create a partition on this disk here of sda our sata ssd and
create a file system on it so remember that little phrase there sda now you don't want to really rely
on those identifiers to reliably exist to identify your disks if and in our case this won't happen
in this little Dell box. But let's say you build a server with four, five, six, seven, eight different
SSDs in it and you sort of move them around. It's possible that on each reboot those devices can
enumerate with different namings. So if you start putting config files together based on SDA
it can sometimes happen that that name will change and then the config file is invalid.
What we want to do is, well first of all we need to create the partitions and then we'll come on
how to actually access the data that's stored on those disks.
But first of all, now this is,
you've got to be careful with this next command, okay?
We're going to use wipefs,
and I'm going to put in devsda.
Be warned, this will delete all the data on your disks.
You can see here that I have, on sda itself,
I have three different entries,
and then under sda1, which is the first partition on this disk,
I have one ext4 partition.
XT4 refers to the name of the file system. So you know that binder you used to carry to school every
day that had like different plastic wallets in it? You can kind of think of those wallets as like
partitions almost. So you've got the big binder which is the disk and then inside the binder are
the different plastic wallets and typically when you're doing a data disk like this you probably
just want one giant partition which is what we have here but I'm going to create it for you on
the stream uh on the video at least in in real time but when you're using um a used disc or even
sometimes when you buy a brand new disc they come for pre-formatted with ntfs or like you you just
don't know what's happened to them before so it's probably a good idea although please exercise
caution double check the commands you're about to run in this next section because they are destructive
so I'm going to go ahead and just do a wipefs minus a on sda1 and then sda and this is going
to remove all of those different signatures that we had on the disk and again if I do wipefs without
without any any commands you can see that nothing exists on the disk now it's completely empty
so if there was data stored on that disk it's now unless you send it to drive savers or something
it's now gone so please please double check before you run wipefs on a disk exercise some caution and
don't just run it willy-nilly okay now we want to create a partition next so i'm going to do
gdisk which is the application i'm going to use to create a gpt partition table
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
create a new partition remember we're just creating the plastic wallet at this point that everything
lives within we're not actually creating the file system yet which is how do you explain that okay
so you've got the binder then you've got the plastic wallet and then with inside the wallet is the
file system is the contents i suppose is the best way to think of it um and then i'm going to do
right here so we now have one partition on this disk and we can we can look at that by doing
fdisc-l dev-sda. You can see that sda1 now exists. So I mentioned a moment ago that we don't
really want to refer to that sda moniker unless we absolutely have to. So what do we do instead?
Well if we go to dev-disc-by-id we actually get a list of all the disks connected to the system
with their constituent serial numbers.
So this means that this is a unique identifier for the disk,
much in the same way that DevSDA is.
And you can see it's actually just a symlink anyway.
So really for me, this is the best way to refer to disks in your system.
So what we want to do now is create that file system
using the ATA SPCC blah, blah, blah.
So by the way, if you want to clear your screen,
you can do a Control-L.
You can also type clear, but I always prefer control L.
So just a free tip for you there.
Now we want to edit a file called fstab.
So we're going to use Vim to do that.
So type VI, edit the fstab.
You can use nano as well if you would prefer.
Now, when I open Vim, I'll try and talk you through the keystrokes
because I really love Vim.
It's one of those editors that once you start using it,
and I've been using it now for maybe seven, eight, nine years,
There is a hurdle to get there, but I promise you it's worth it.
All right, so you open Vim.
You do a Shift-G.
That takes you to the bottom of the file.
You now press O, and this puts you on the next line,
but it also puts you into insert mode,
which means you can actually type stuff,
because that's something that often confuses newbies with Vim.
So we're going to do slash dev slash disk slash by hyphen ID,
and then put in the name of our partition.
we are now going to do mount ssd so this is where we're going to mount the data directory to
we are then going to mention the file system type that we are using so in this case
i want to keep things incredibly simple excruciatingly simple for this video
we could use zfs here we could use butterfs or bcachefs but each of those things are what are
called copy and write file systems they they they can do things like snapshots and replication
and they have a huge amount of features but again like that's step 73 in and we're on step one or
step two here so i want to keep it really simple with ext4 um it's a really old tried and trusted
and true file system on linux if you want to use something else at this point please go ahead and
do that i won't uh i won't come and mark your homework down for doing it but if you're just
long ext4 will do you just fine for now next we want to put in defaults no a time and discard
some basic stuff here for the fs tab file and then we are done so to exit insert mode we press escape
and then we do colon write colon w and then quit and now that file has been modified so if we do fs
tab, we can see here that the edits we made have been persisted, I guess. Now we want to create the
far system on this disk. I don't think I did that, did I? So we want to do makefs.ext4 and then put
in the partition that we want to put ext4 onto. That's now created the ext4 partition on the disk
for us. The last thing we have to do is create the mount point. This is where the disk is actually
going to be mounted by proxmox actually i'm going to create mount ssd1 because who knows maybe we
add another ssd later and then that means i've got to edit my fs tab again so i know i want to look
for the phrase ssd so if i press forward slash ssd that'll take me right to the part of the file i
want to go to and then i can do insert one so insert it means letter i type the number one press
escape, press colon, write quit, and trust me, this stuff becomes muscle memory after a while.
If you've been looking for a way to start Vim, Vim Tutor is a really good way to do it. Stick that
into Google, you'll probably lose an evening to it, but you're welcome. All right, so we now have
FSTAB created, we have a file system on the disk, and I think we're good to go. So let's do mount A.
Ah yes, we need to do systemctl daemon reload to pick up the new FSTAB file that we just created.
mount-a and we can type mount again and we can see that this disc is now mounted on our system.
One last tip, here's a new app that I just found that I absolutely adore, it's called DUF. It just
prints you out a really nice, easy to read, like overview of all the different things on your system.
There's a bunch of other stuff you can do with it if you do dash dash help. We won't get into that
for today. So I think if I look back at my original running sheet, we've done all of the
Proxmox setup piece now, which means the next chapter is going to be installing Image. Next up,
it's time to install Image, the self-hosted Google Photos clone. And you can find them over at
image.app. Now they have a wonderful getting started section on their website, but we're
going to do things slightly differently. For example, they recommend that you use an end file
with your Docker Compose file. There's a couple of things I'm not going to do the way they recommend.
I just prefer to keep things fully declarative and have everything in just one single file.
So link in the description is a copy of this file and the reason I modified it slightly is for a few
reasons. First of all, we want to put image on our tail net. So we're going to do that using this
sidecar method and this effectively creates so you've got the image application server over here
and then you've got the image tail scale connection server we kind of merge those two things together
we've done this many times on the channel now you kind of merge these two things together using this
network mode command here and it basically puts image directly onto your tail net so you can access
it from anywhere in the world using tail scale serve with no reverse proxy configuration required
so in the description down below will be this file the whole thing there's several containers in here
you've got the image ts container first of all you've then got the image application server
container and these paths will come on to these in just a minute don't worry
you've also got the image machine learning container this one's pretty interesting and
i have a video linked up here where you can look at how to do remote gpu machine learning for image
So if you're importing 100,000 images or something, you could have an NVIDIA GPU in your gaming rig,
actually do all of the processing and machine learning and face recognition for image,
and spare the poor CPU of your little Dell box or something like that.
We're just going to run this all in CPU mode today and all in one place,
but if you did want to do remote learning, like I say, there's a link to a video.
I've already done about that.
Now, Redis is a piece of software that essentially just acts like a sponge.
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.
So Redis kind of just acts like a buffer, if you like.
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.
So it's a queuing piece of software.
So if you ever wonder what Redis does, that's what it does.
And then you've got the database, of course, which is a very important piece of software using Postgres in this case.
Now, the way that Docker works, we're going to need to do something with what are called volumes.
These are a way to persist data outside of the container runtime environment,
such that when you destroy and recreate the Docker containers,
all of your databases, all of your pictures and everything remain intact,
which is obviously what we want.
So we've got to make sure that some of these paths exist.
Now, on our Dell box, we already know that this path exists of mount SSD1 as defined here.
But if this data path doesn't exist, Docker will go ahead and try and create it.
However, further up in our image TS thing, we need to create these paths here
because we've got to put a couple of config files in there in order to configure the tailscale container.
So let's go ahead and create those paths.
I've just copied that path onto my clipboard.
Again, via SSH, I'm going to do make dir minus P.
It's going to create this whole folder path for us of mount ssd1 at data image tsconfig.
I'm also going to do the same thing with tsstate.
By the way, if you want to delete the whole string, you can do a ctrl-w,
and that will delete the entire word behind the cursor.
And then on image server, we also want to make sure that we have this directory actually exists.
It may already contain data in your case.
you know you might already have a directory with folders in it but I don't think we do here do we
no data does not exist so we don't have to create this in this case because like I say image would
go ahead and automatically create it for us but it can't hurt to create these directories now I
don't think I have this app installed so I'm going to install it right away tree is an application
that lets you list out directory structures okay so you can see here we've now created a few
different directories. We've got app data, image, tsconfig, tsstate. We've got data, photos, upload.
And this is just reflecting what's in our Docker compose file. Now in terms of what we need to do,
we need to put a few files in a few places. So let's create in here, we've got app data image.
So in that folder, let's go to here to app data image. We're going to create a new file called
compose.yaml but we're going to do that from vs code now if you didn't know tailscale make a vs
code extension so you can go to the extensions option over here search for tailscale and install
that directly into your vs code editor the benefit of this is you can now click on this little tail
scale button and you can see all of the nodes in your tail net now okay i've only got a couple
but we want to do things like change the ssh username i'm going to change mine to root
and then I'm going to change the path.
I'm going to right click
and then change root directory to root.
I think by default,
it's the home directory of the root user,
but I want access to the entire system.
And now if I click this little caret icon
next to this and expand,
you can see I've got access
to the entire file system of this remote node
over tailscale.
Remember, we haven't done any usernames
or passwords or SSH keys
or anything like that
to kind of verify identity.
All we've done is installed TailScale in both places and logged in, and it handles the rest.
It really is magic.
Okay, so under MNT SSD1, we can see the same data structure that we just created in the command line.
And this is useful for us today because we need to put a few files in place.
So I need to rename that to image.
By the way, this file is, of course, linked in the Git repo in the description down below.
But under here, we've got a couple of files to move around.
So I need to copy this image.json file.
I'm going to just copy this onto my clipboard
and then go over to the tailscale extension.
And in TS config, I'm going to create a new file
by right-clicking new file and call it image.json.
So I'm just going to copy the contents of that
into my image.json file on the remote server now.
Okay, so we've got our reverse proxy configuration here done.
So this is going to handle configuring tailscale serve
for us programmatically as part of the container deployment. We also need to make sure that we've
got our auth key. So over at tailscale.com we can generate ourselves an auth key by going to our
admin console, settings, keys and then generate an auth key and I'm going to call this one image
test. I'm going to make it reusable because I'm doing a demo and I'll probably tear things up and
down a few times. You can leave this completely by default if you would like to. Now I'm going to
copy my auth key into my Docker Compose file,
just replacing this TS auth key bit here.
And now I'm going to take this entire Compose file
and I'm going to put it into this image directory right here.
So I'm going to click on new file, compose.yaml.
I'm going to open that, paste, and now we are good to go.
So if I do a control back tick,
that's going to bring me up the built-in terminal.
Or if I want to open a terminal via tailscale in the exact directory that I want to be in,
I can just click on this little button here in the extension,
and it takes me right to where I want to be.
Isn't that cool?
Okay, so for the purposes of video, I'm going to make things slightly bigger
and just have things here.
Okay, so we have our compose file.
Again, I'm going to run tree.
We have our compose file.
I think everything's set up in there.
we have our JSON image file to. It's time we started things up. So let's do a Docker Compose
pull. This is going to pull all of the images that we need to run image locally, which in my case took
about 45 seconds. I'm now going to do Docker Compose up minus D. And then just to view the logs and
double check about everything's going on and configured correctly, I'm going to do Docker
overcompose logs minus f and all being well this is going to do several things it's going to spin
up the database it's going to spin up image it's going to add image to my tail net and hopefully
everything will just work hopefully i've sacrificed enough to the demo gods today okay first things
first we're off to a good start the image container has automatically added itself to my tail net so
i'm going to copy this url here and if everything worked correctly it's now going to go away in the
background and yet start generating a certificate for image.velociraptor again this can take a
a minute or two just like the proxmox one did it's generating the certificate requesting the
certificate and voila we're done we've deployed image now i get a lot of feedback from people
saying that we need we need a ui for docker we need a ui to manage our containers and i do
appreciate that by the time you have to drop to the terminal you've already lost a good portion
of your audience but the reality of self-hosting at least in 2025 at least is you do still have to
roll your sleeves up and get a little bit dirty however it's a lot easier than it used to be we
just simply deployed two files two yaml files and i think that's probably within the realm of most
people's ability to just deploy two files we've got the compose yaml and the image json and that's
it reverse proxy is taken care of it's on our tail net and we can access this now from anywhere in the
world. So let's just have a very quick poke around with an image. Let's click on get started. Admin
email. Yeah. Okay. Right. I'm just going to skip past this stuff because I don't think we really
need to worry about it. And the storage template thing, I see stability issues here. I'm just going
to ignore it. I'm going to leave it disabled. I don't want my photos to be unstable. I also added
a few photos from my personal collection here just so we can see what's going on. And I want to show
you in real time, actually I don't think I have HTOP installed, let's be fast, I want to show you
just how much CPU Image is actually using. So you can see that just for a few seconds there it was
using all four CPU cores to 100%. That's because in the background Image is doing a whole bunch of
machine learning on these images to detect what's in them. So I know that all happened very fast but
let's just do something like search for the word road. Image is now using its machine learning
capabilities to look for anything in the images that looks like a road or indeed let's go for
train i know some of these are really easy and basic but you can start doing things like
what should we do tree sunset you can start concatenating these things together
an image will go and find you know look at this this this is not even clearly sunset
you've just got a little bit of golden light on a mountain in yosemite and it works out what's
going on like obviously this bison picture at sunset is clearly sunset but I just think it's
absolutely phenomenal we're doing all of this without a GPU now admittedly there are only
15 images you can imagine if you start putting 100,000 images through this thing it's going to
start crying and being like oh just where the GPU comes in but like I said there's a video about that
up here so a couple of things to pay attention to in the settings of image you can see there is lots
of stuff going on here. An interesting one for tail scale users might be the partner sharing
feature. Now you're going to need to go into your image settings, create a new account and then add
a partner and you can see that, well let's actually do that in real time so I can show you.
Show don't tell Alex, that's what you need to do. So let's just do test at test.com,
ABC123, see if it lets me do that one. Test, okay let's create that user. Cool, yes test, yeah fine.
Let's go to account settings and create the partner sharing option.
This is neat because it lets you effectively share all your photos and videos with your partner.
So you can have two people access this Image instance because the lead developer of Image,
a chap also called Alex, excellent name by the way,
he just wanted a way to share his photos with his wife.
Image began as a way for this guy to scratch his own itch to replace Google Photos.
And it's developed into this absolutely glorious project that we have in front of us now.
And that's really it.
There's a lot more I could dig into with Image.
I'm not going to in the interest of time today.
Because next up on our agenda is installing our audiobook app.
I promised you an introduction to the wonderful world of self-hosting.
And so far, we've looked at how to replace Google Photos with Image.
And now we're going to look at how to replace Audible with Audiobookshelf.
The ecosystem of applications is constantly growing and in fact there's a whole list over at Awesome
self-hosted on GitHub where if you want to find out more software to host there's a huge list on
here. So if I type in audio bookshelf for example there it is under media streaming audio streaming
there's a bunch of stuff here. Stuff that will let you replace things like Spotify with Navidrome
and there's all sorts of stuff. But today we're going to focus on audio bookshelf and much like
we did with image linked in the description down below is this docker compose yaml file
i'm going to copy my ts auth key from my image deployment into my audio bookshelf yaml file
now something i didn't point out in the image section is this hostname variable here this is
the name that the container or therefore the service will get when it joins your tail net so
we've got to make sure that that name is something that you want and then also you've got to make
sure that this network mode line is present here. So service and then this name here of service must
match the name of this key I suppose in the YAML file right here. So the syntax needs to look a
little bit like this. You need network mode service colon image audio bookshelf and then everything
will just work just fine because we're not exposing. So one of the concepts of containers that we didn't
get into yet is how it's an encapsulated thing. Nothing's allowed in or out unless you explicitly
define it. So right here we're explicitly defining that this container is allowed to reach out onto
the host system and look for audiobooks for example on mount ssd1 app data. Now we also want to modify
this file path to be ssd1 media for example audiobooks. So you can modify these paths to your heart's
content. I don't really mind where you store anything but the general idea in this scenario
at least is that we're storing the actual data on the second ssd that is called ssd1 confusingly
here but not the primary boot ssd for proxmox we're storing that on like our data drive
we store that there for just a separation of concerns really so much like we did with image
i'm just going to copy this file now using the tailscale extension and then in here i'm going to
create my compose file now you could put this stuff in the same compose file as you did with
image really is personal preference as to how you organize things. You can have one giant
compose file and certainly many people do, myself included, on my server so that I don't have to keep
changing directories to get the correct context into my Docker commands. But I think for the
simplicity of a beginner tutorial, having that switching of context between different applications
might actually be helpful. Okay, so we need to make sure like we did in part one with the image
container that this path actually exists. So I'm going to change to my terminal here
and do the make dir minus p again just to make sure that audiobookshelf tsconfig actually exists.
Then back in my VS Code window I'm going to click this little refresh button up here
and you'll see that tsconfig has now been created. So what I need to do here is copy across again
my reverse proxy configuration. Now audiobookshelf by default runs on port 80 so you can see I've got
AT configured here. That's really the only thing you need to change between different applications.
This audiobookshelf.json
looks exactly the same as image.json
except for the port number.
Okay, so let's get the audiobookshelf.json
copied over.
New file
audiobookshelf.json
Let's open that,
paste that in. And so now we should be good to go. So I'm going to change
out of the image directory by doing cd dot dot to go up a level you can see i'm now in mount ssd1
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
deep in the directories so you can see we've got the audio bookshelf directory with a compose file
and we've got the image directory with a compose file image is still running in the background by
the way if i do a docker ps minus a you can see the image is still there running in the background
but we want to do audio bookshelf now so I'm going to change into the audio bookshelf directory
do a docker compose pull that's going to do the same thing again now you'll notice
that the image audio bookshelf container in fact I've just spotted an egregious mistake
this yeah you can tell I copied and pasted this can't you I need to change this from image audio
bookshelf to audio bookshelf ts and then of course how did i not spot that when i was talking to you
a minute ago you're probably screaming at the screen going alex anyway it's done now it's fixed
it's okay we didn't actually create anything um so let's go back paste that into our remote node
and save the file and so now we when we do a docker compose pull it has already pulled the images
we're good to go so we've got the audiobook shelf app and then app minus ts so if we do a docker
compose up again minus d it's going to create those applications for us and then again we do a
logs minus f just to double check that everything's going on and working for us uh just fine beneath
beneath the covers so let's go back to our tailscale admin console and just verify that that
node has been added and created you can see we've now got an audiobooks node on here so i'm going
copy that to my clipboard and paste that in here and all being well we're going to now go out to
let's encrypt and request a certificate with our acme account this will take just a moment or two
and voila we now have our audiobook server on our tail net so i'm going to create my username here
again of zafod just create a random junk username and password and click submit
Okay, let's get logged in with Zaford.
So now it's time to create our first library.
Now, let's look back at the Docker Compose file
and kind of explain the anatomy a little bit
of a Docker Compose creation command.
There are several volumes defined here,
and it might be confusing if you've never seen this before
as to what's going on.
This is the path that actually exists
on the physical Dell host, not inside the container.
So you can think of this thing before the colon
as being the external point of data, where it exists on the host.
You then want to think about, after the colon here,
of slash audiobooks being inside the container.
And indeed, we can see that now.
If we go to add your first library, I'm just going to call this one audiobooks,
and I click on Browse for Folder,
you can see that audiobooks exists inside the container, slash audiobooks.
If I click Select Folder Path and Create,
We've now got an empty library.
And if I click on the scan button, it's now going to scan for books inside that library.
And we can see that George Orwell Animal Farm indeed now exists.
Animal Farm by George Orwell.
Fantastic.
Okay.
So what we haven't done yet is we haven't connected up our phone to either image or audio bookshelf.
And I think that's a really important part of this entire solution.
So I'm going to put this under a new chapter down below, so I'll be right back.
So one of the entire points of this tutorial series is to show you that with self-hosting and Tailscale,
you can access your self-hosted services from anywhere.
No firewalls, no complicated configuration or anything like that.
So it's time to grab your phone and go to the App Store of your choice.
We have apps for iOS, for Android and many other platforms too.
I'm just going to search for Tailscale in the App Store here and download it to my phone.
whilst I'm here I'm also going to search for the image app and download that one too along with
an app called plapper there are several different audiobook clients for audiobook shelf for ios
plappers one shelf player is another one you can see that one just a little bit below it
um I think there might also be an audiobook shelf app but I think it's only in um test flight mode
So let's just double check that.
Yeah, I've definitely seen it at some point,
but I think it's only available in TestFlight,
and honestly, it could use some more work.
But if you're on Android,
the official audio bookshelf app actually works pretty well.
So we've got Plapper.
Where do these names come from?
I'm going to put that on my home screen.
I'm going to get Image and put that on my home screen.
And then also Tailscale 2.
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.
I'm going to go through and click all of the sort of entry wizard.
I'm going to install VPN configuration.
Yes, it's going to ask me for my passcode.
And then it wants to get logged in.
Now I'm going to use my Google account, the same account that I logged in with my laptop.
And I've just logged these two different services in as well.
I'll have a tail and scales at gmail.com and then connect this device to my tail net.
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.
I could literally go to Safari and put this in here, and it will just work.
But Image has some nice features when you get to iOS, like automatic backup of pictures you take and things like that.
So let's use the application.
I'm going to install the or allow notifications, paste in the URL for image here into the client,
get logged in with, what did I put, a tail and scales at gmail.com and then I'm going to allow
it full access to my photos. So this icon up here in the top right allows me to back up pictures
that I take. So let's click on recents and for example and now if I click start backup it's going
to start uploading things from this phone like screen recordings and all sorts of other stuff
you can see that photos i took on this phone are now automatically uploaded in fact let's
let's take one in real time and see sort of what happens here we go bink all right so going back
to the image application i'm just going to quit this thing and reopen it and do a i think you can
start a manual backup each time or you can have it automatically backup photos when you're charging
much like google photos within the background there you go there's the picture i just took
so in real time you know i've been able to you can see i'm cheating using
claw down the bottom there look for some commands but you can see really just how easy it is to
replace some of the hosted services so for example image now is pretty much in a position to
completely replace google photos for me all right so that's that's image what about audiobooks now
we want to put in the fully qualified domain name for audio bookshelf and to save me a bunch of
typing on the phone i'm going to go back to the tailscale app copy the magic dns name and put that
into the audio bookshelf piece right here what username i think i set xafod didn't i
let's
do
Zaphod and then just the username and password this way. On all being well I should now be able
to see my Animal Farm audiobook. Great, logged in now so I'm going to click on the audiobooks and
just like that I'm able to listen to Animal Farm by George Orwell narrated by Stephen Fry.
And then I can download the books, okay I didn't know this but there is a small fee to unlock
features like downloading audiobooks for offline listening and all that kind of stuff
supporting the developer i have no problem with that but you can you can generally get the idea
here that this this is a way to replace audible okay so we've replaced google photos we've
replaced audible and they're both now on my phone so you know two services are really very very
useful in my life i've now replaced with self-hosting now what about home automation we can come on to
Home Assistant next. You see this one up here? This is hiding, it's ready, but we need to actually
deploy Home Assistant. This is a bit different how we do this one. We're not going to do this with a
container. We're going to do this using the helper scripts from helperscripts.com on top of Proxmox.
Home Assistant is one of those projects that if you haven't heard of it, you absolutely should
give it a look. I'm sure at some point you've gone to Best Buy or something like that and bought
a smart product like a hue light bulb or some kind of internet connected thing and then each of those
things comes with their own app and so you end up having 15 different apps on your phone one to open
your garage door and one to turn the lights on and it's just a mess well home assistant pulls all of
those different ecosystems together into one place and puts it as a local control with privacy first
smart home system. The really cool thing about that is you can then have those disparate ecosystems
triggering each other. So when you turn on the light bulb in the kitchen, for example,
you could have it turn on or close your smart shade in your bedroom if you want to. I don't
know why you would do that specific example, but it could be really useful to have all these
different things be able to trigger each other. So let's dig into how we actually go ahead and
deploy home assistant now in this epic beginner's guide to self-hosting video so i'm going to go
back to my old friends over at helper scripts and i'm going to search for home assistant we're going
to deploy home assistant os as a vm and then i'm just going to copy this string here this how to
install option here i'm going to go back to my proxmox box and then just copy and paste this
into the shell this is going to take us through a little wizard and rather than creating home
assistant as a container or anything else like that we're going to do it as a vm because home
assistant os is this fully encapsulated thing for home assistant it contains all of the dependencies
and it's it's its own kind of little world for home assistant um yeah it's just the easiest way
to go i think particularly for beginners so let's go through the wizard and we're going to go through
the advanced options just to see what's open to us stable version yes that sounds good virtual
id 100 would probably be fine but i'm going to set 333 just i don't actually know why
i440x right through cache yeah fine oh host name i'm going to set to home assistant
and then we're going to do host cpu yep that's fine our little dell box has four cpu cores so
i'm going to set that for ram i'm going to do 8192 for eight gigabytes vm bridge zero is fine the
MAC address is fine, the VLAN is fine, the MTU is also fine. Start VM when completed, yes, and ready
to create, yes. So now the script's going to go through and create the virtual machine for us.
We'll do a couple of things once it's created. We're going to attach it to our tail net and then
also install a certificate so that you can access it from your phone, of course. That's been the
theme of this video, I know, but we've done it with containers thus far, and one of the reasons I
wanted to show Home Assistant here is because, well first of all, it's a really cool application.
It's one of those ones that make you feel like you're solving real problems in the real world with self-hosted software.
And for me, that's where when you start connecting those real problems with real solutions,
that's where the magic of self-hosting really starts to come alive.
So we can see here that the VM has now been created.
It's going to boot up for the very first time.
Let's wait and see what IP address we get.
You can see, by the way, that a virtual machine is basically just emulating a small computer
with inside your little Dell box.
So it's emulating memory, it's emulating a processor stack, a disk stack,
it's pretending it's got a real screen, a real SCSI control, all this stuff.
It doesn't actually matter.
But if you want to view the console of the output of that machine,
you select the virtual machine in the Proxmox web interface,
which, by the way, why am I not on my little PVE?
Alex, Alex, Alex, Alex.
Here we go.
I should be using my little PVE thing with Tailscale serve, shouldn't I?
All right, so let's go Home Assistant console,
and we've got now an IP address of 192.168.1.118,
and then Home Assistant runs on port 8123.
This initial setup can take a minute or two.
It's doing things like expanding the disk, downloading any containers,
and just instantiating itself, just creating itself,
getting itself ready to go.
So when that's complete, we'll be back in a minute.
Okay, the initial installation is complete.
I'm now going to create my smart home,
tailscale towers, sure, why not?
Username of Zaphod,
let's just create a random junk username and password,
create account, fantastic.
Location, doesn't really matter.
In this example, you can of course go ahead
and configure this however you would like.
But you can see already,
this is one of the absolute magical things about Home Assistant. It's already detected all of these
different compatible devices on my network. So my Android TV, my Apple TVs, Ecobee thermostats.
It's just amazing. Absolutely amazing. And out of the box, it gives you a very best approximation
of like a dashboard you might want. Like I can already control the light that's up here, for
example as part of my filming setup directly from home system with no additional configuration
how cool is that all right enough fanboying out of the way with with home assistant it's time to
actually get this thing on our tail net so let's go down to settings let's crack on and install an
add-on or two first of all we're going to want to install the tail scale add-on so just a case of
clicking install here and then we're also going to want to install the studio code server add-on
and this will become clear in just a moment as to why we want to do that too okay so let's go back
to settings and add-ons once more and we're going to start up the tailscale container i say container
add-on it is really just a container under the hood it's all just docker masquerading but um
now there is an option in fact i did a tutorial which i'll put a link to up here about you can
click on open web UI and get logged into tail net but for me for some reason it's not working
so to get around this we can go into the logs of the container and click on this little URL here
and authenticate to our tail net that way so little work around I'm not sure why it's it's
not working I'll file a bug for that internally and hopefully we get that fixed by the time this
video comes out so I'm going to click on connect and then visit console and you can see that my
Home Assistant now exists in my tail net so if I want to connect to this instance I can do 8123
and I can now connect to Home Assistant from anywhere in the world that I'm connected to
Tailscale but you know me I like to have full-on TLS certificates wherever possible so this is where
the studio code option comes in so let's go back to the documentation section of the Tailscale
community add-on which by the way is maintained by frank who seems to be like the most prolific
home assistant uh developer going when it comes to all the add-ons he does the tail scale add-on
he does the the code the code studio add-on anyway he's a good dude um so let's go to
documentation and scroll all the way down to where it starts talking about proxy the home assistant
add-on calls it proxy we call it tail scale serve so those two things are the same i don't know why
it's called proxy in the home assistant add-on c'est la vie i guess okay so we're going to copy
these four lines onto our clipboard and then we're going to go to our add-ons page again and start
the studio code add-on i'm going to click show inside bar and so take just a minute to start up
now we could click on open web ui but i i've already clicked the show inside bar button so it
shows up here for all time because it's really handy to have this little studio code server
available as part of Home Assistant. You can see we're basically just loaded now into VS Code but
in a browser. So look for this file here configuration.yaml and paste in those four lines
from your clipboard and then because you're in a browser some of the keyboard things don't pass
through correctly so file save manually just to make sure that this file does actually get saved.
go to settings and then restart home assistant
this will take maybe 10 or 15 seconds on the completely fresh install
on a more mature install it could take a minute or two depending on how many add-ons you've got
and that kind of thing but once it's back up and running you want to go back to add-ons and then
tail scale and then configuration click on show unused optional configurations and look for
tailscale proxy check the box click save the tailscale add-on is going to have to restart
yes that's fine go ahead and do that and then we want to look in the logs for all of the acme
requests for the tls certificate in fact there we go this is now available within your tailnet on
this url right here so all being well home assistant still restarting of course but the
actual add-on is doing exactly what we wanted it to do. You can see we've got a full HTTPS
certificate at homeassistant.phelociraptor-noodlefish and we are now good to go.
Get logged in with my username and password and voila I can now access this from anywhere on my
tail net. So let's do that let's control this light on my desk in front of me over tail scale
over 5G. So let's turn the Wi-Fi off on my phone. Let's load up Home Assistant. In fact, I'm going
to load up Tailscale once more because I hate typing. And then I'm going to go to Home Assistant,
copy this URL right here, I suppose the DNS name. I'm going to go into the Home Assistant
application. I'm going to enter my address manually and paste that from my clipboard.
I want HTTPS. Yes, thank you, Home Assistant. I'm going to connect to that. It's going to ask me to
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
network as this which means I could literally be anywhere in the world I know I've belabored that
point but tailscale is amazing sometimes and just simply by pressing the button on my phone over 5G
with home assistant in what I've been filming this segment for 13 minutes I'm sure in the edit it'll
be a little bit less but we've just set up home assistant and that's it that is the magic of
tailscale right there the magic of self-hosting and tailscale i suppose actually so what have we
done today we have set up a google photos replacement we have set up an audible audiobooks
server replacement we have started you down the journey of open source self-hosted privacy
respecting home automation and we've connected all those things using our phone over 5g using
in Tailscale, we haven't configured a single firewall rule. We're not paying for any subscriptions
for any of this stuff. Tailscale is completely free for home users, remember, 100 devices
and three users for free. And a device, by the way, counts as these. So we've used five devices today
towards our 100 device limit. But if you share Tailscale with friends and family, you can add
two devices to that free limit every time you refer someone to Tailscale as well.
So I know that was a super long, epic two-part series
on how to get started with self-hosting.
If you have any questions about anything you've seen
in today's video, I'll be doing some live streams
over the next month or two where you can come
and ask me questions directly.
Or indeed, you can just leave a comment down below
with a question and I'll do my best to reply
or even put that into some kind of like an ask tail scale
like video at some point in the future.
I should probably do one of those.
But yeah, super long video.
If you've made it to the end, thank you.
Please leave a comment down below with the word bananas.
And until next time, I've been Alex from Tailscale.