Skip to main content
Hyper 8 Spacefun Videos

immich - deine eigene Fotoverwaltung

Hallo liebe Weltraumflugbegleiter. Als ich jung  war, gab es so etwas wie Instagram, Facebook,   00:00
Google Fotos oder Ähnliches natürlich noch  nicht. In diesem Video möchte ich euch zeigen,   00:07
wie ihr selber eure eigene Fotoverwaltung bei  euch zu Hause hosten könnt. Vielleicht erinnert   00:13
ihr euch ja noch, damals gab es so etwas wie die  Fotobücher, die Freundebücher, die sahen so aus.   00:21
Ich habe mich da immer mega drauf gefreut, unter  anderem, weil die halt diese schönen Pferdemotive   00:27
hatten. Hier konntet ihr dann ein Foto einkleben  und so allerlei über euch erzählen. So etwas   00:32
Ähnliches haben wir auch mal von der Free Software  Foundation digital als Webseite zusammengebastelt.   00:39
Das gibt es heute leider nicht mehr online. Ihr  könnt das aber selber mal angucken. Und zwar gibt   00:45
es das hier auf der Webseite notabug.org und dann  könnt ihr hier auf erkunden und sucht einfach mal   00:50
nach Fotobuch und dann ist das hier das Projekt  von mir 'fsfe-zh / fotobuch' und hier könnt ihr   00:56
das dann auch herunterladen. Entweder hier über  diesen Download-Button oder ihr kopiert euch die   01:06
URL und cloned euch das dann hier mit git. Ich  habe hier im Verzeichnis git, git clone und dann   01:11
paste ich hier diese URL rein und im Hintergrund  cloned er jetzt schon dieses Fotobuch. Das zeige   01:18
ich euch gleich mal. Aber heute wollen wir ja  eigentlich eine Fotoverwaltung installieren,   01:24
und diese Fotoverwaltung, die nennt sich immich  und die zeige ich euch gleich mal ganz genau im   01:29
Detail. Wie üblich werden wir das Ganze dann in  Docker installieren mit Docker Compose, denn dann   01:36
ist es wirklich nachhaltig und wir haben unser  System voll unter Kontrolle. Als Basis nutze ich   01:42
wie üblich meine eigene Linux-Distribution. Die  findest du hier auf der Webseite spacefun.ch. Ich   01:48
nutze für Server üblicherweise die Variante Tuxwiz  in der Stable-Edition. Die könnt ihr dann hier   01:55
herunterladen, sobald ihr ein Ticket bezogen habt,  und die eignet sich wirklich, wirklich sehr, sehr   02:03
gut. Diese Variante basiert auf Debian Stable und  ist sehr leichtgewichtig, hat aber trotzdem immer   02:08
noch einen Window Manager dabei, nämlich IceWM.  Du kannst also auch eine grafische Oberfläche   02:16
damit nutzen. Ich baue meine Selfhosting-Projekte  in der Regel mit VirtualBox. Du kannst natürlich   02:23
auch so etwas wie KVM, QEMU oder etwas Ähnliches  nutzen. Einige von euch verwenden sogar Proxmox.   02:29
Das ist natürlich dann wirklich das Riesenteil,  da könnt ihr auch mit arbeiten. Das ist auch eine   02:36
super Lösung. Ich verwende hier VirtualBox.  Wenn du VirtualBox nutzt, stelle sicher,   02:41
dass du in der VM in den Netzwerkeinstellungen  den Bridged Modus eingestellt hast, denn nur so   02:46
bekommt er tatsächlich auch eine IP-Adresse aus  deinem lokalen Netzwerk zugeteilt. Er hat hier im   02:52
Hintergrund dieses Git-Repository schon geklont  und ich kann da mal kurz reinschauen. Ich möchte   02:58
euch das trotzdem noch mal ganz kurz zeigen.  Hier gibt es dann diese index.html, die öffnet   03:03
der mir hier einfach dann im Browser. Und hier ist  unser Freie Software Fotobuch, in dem ich Freunde   03:08
von mir eingeladen habe, sich wirklich hier mal  abzubilden und ein bisschen über sich zu erzählen.   03:13
Die Anmeldung funktioniert natürlich nur, wenn  das Ganze auf dem Webserver läuft mit PHP mail.   03:18
Das ist jetzt hier nicht der Fall. Und da sind  dann hier die Freunde von mir auch abgebildet   03:23
und die haben dann immer auch ein bisschen über  sich selbst erzählt, ihre Lieblingsprojekte,   03:27
was sie so begeistert an Freier Software und  das finde ich wirklich eine ganz tolle Sache.   03:32
Elias ist leider mittlerweile verstorben, ein sehr  guter Freund von mir. Er hat sich hier im Fotobuch   03:37
aber auch noch wirklich verewigt. Ihr könnt hier  oben auch die User dann, also die Freunde hier   03:43
auswählen und ihr könnt das natürlich auch selber  erweitern und auch für euch gestalten. Das Ganze   03:48
ist natürlich dokumentiert und so könnt ihr euer  eigenes Freie Software Fotobuch mit euren Freunden   03:53
zusammen gestalten oder ihr committet das dann  hier in das Git und wir freuen uns natürlich   03:59
auch über weitere Einträge hier im Fotobuch.  So viel dazu. Ich möchte jetzt hier einmal   04:05
umschalten auf meine Tuxwiz-VM. Das ist jetzt  hier mein Spacefun-System mit LXQt. Ich schalte   04:12
hier mal um und hier habe ich jetzt schon mein  Tuxwiz vorliegen. Das Ganze hat der Lars Müller   04:18
mal auf unserer Webseite gnulinux.ch ganz gut  dokumentiert. Da gibt es hier eine Dokumentation   04:25
zu immich und die werden wir zum Teil auch nutzen.  Ich orientiere mich aber üblicherweise erst einmal   04:33
an der Upstream-Dokumentation, also an dem, was  das Projekt tatsächlich da auch beschreibt. Und   04:40
das findet ihr auch hier am Ende, die offizielle  Dokumentation, und die öffne ich als allererstes   04:47
mal. Hier wird sogar empfohlen, Docker Compose  zu verwenden. Als Voraussetzung, wie üblich,   04:52
müsst ihr eine DynDNS-Adresse haben. Dann  müsst ihr in eurem Router den Port HTTP, also   04:58
Port 80, und HTTPS forwarden auf eure virtuelle  Maschine. Die IP-Adresse eurer virtuellen   05:05
Maschine könnt ihr z.B. mit dem Befehl 'ip a s'  herausfinden. Das wäre jetzt diese hier und darauf   05:12
müsst ihr dann den Traffic forwarden. Das habe ich  in einigen anderen Videos schon im Detail erklärt.   05:19
Schaut da wirklich noch mal rein, falls ihr euch  unsicher seid, oder fragt mich einfach. Hier ist   05:23
jetzt also die Variante mit Docker Compose. Ich  brauche natürlich als Erstes mal Docker. Das ist   05:29
hier noch nicht installiert. Also, ich sage  jetzt mal 'sudo apt install docker'. Das ist   05:33
jetzt halt hier ein Debian System. Das sollte  in den Repos drin sein. Das heisst aber nicht   05:39
docker. 'apt-cache search docker' und dann sehe  ich alle Pakete, die halt Docker enthalten. Und   05:45
ich könnte da sogar auch noch mal hier so ein  Dachzeichen vorne angeben. Dann zeigt er mir   05:54
wirklich nur die Pakete an, die Docker am Anfang  haben. Also dieses ^-Zeichen. Da muss man danach   06:00
immer noch Space drücken und dann findet er auch  hier diese Docker-Pakete, die Docker tatsächlich   06:05
hier enthalten. Und das Wichtige ist hier dieses  Paket docker.io und das installiere ich jetzt mal 06:11
'sudo apt install docker.io'. Und jetzt wird hier  Docker im Hintergrund schon installiert. Docker   06:18
hat üblicherweise auch immer eine Gruppe,  eine 'docker'-Gruppe, und ich möchte diese   06:25
Software im User-Kontext ausführen, nicht als  Root-Benutzer, als mein User. Mein User heißt   06:31
hier 'tux' in diesem Fall und deswegen muss ich  diesen User dann noch dieser 'docker'-Gruppe   06:36
hinzufügen und mich einmal ab- und wieder  anmelden, sonst funktioniert das Ganze nicht.   06:41
Und dazu mache ich dann gleich einfach mal ein  'usermod', also sudo usermod -a -G, dann den   06:46
Gruppennamen und meinen User 'tux'. Und jetzt ist  der User 'tux' da schon drin. Jetzt melde ich mich   06:53
einmal ab und dann melde ich mich gleich wieder  an und dann sollte das auch schon passiert sein.   06:58
Das kann ich jetzt noch prüfen mit 'id' und dann  sollte ich hier auch diese 'docker'-Gruppe dann   07:09
tatsächlich hier sehen. Da ist sie. Jetzt öffne  ich noch mal die Webseite mit der Dokumentation,   07:14
damit wir uns dann da auch durchhangeln können.  Also hier war die Dokumentation von immich. Ich   07:21
sage jetzt hier trotzdem noch mal, ich öffne auch  die Webseite von von uns mit dem Artikel von Lars   07:27
Müller. Dann können wir uns das gleich auch noch  mal angucken. Also hier sagt er mir jetzt als   07:34
Erstes, ich sollte erst einmal die benötigten  Dateien herunterladen. Er empfiehlt jetzt hier   07:39
z.B. ein Verzeichnis immich-app zu erstellen  in dem Ordner, wo ich jetzt gerade bin. Ich   07:44
bin jetzt hier in meinem Home-Verzeichnis. Das  kann ich prüfen mit 'pwd'. Das mache ich jetzt   07:50
mal. mkdir ./immich-app erstellt das Verzeichnis  genau dort, wo ich mich jetzt befinde. Jetzt sage   07:55
ich einfach nur mal 'ls', einfach nur mal 'ls'  und da sehe ich das schon, dass das Verzeichnis   08:02
hier erstellt worden ist. Da gehe ich jetzt mal  rein und dann empfiehlt er mir jetzt hier diese   08:09
Docker-Compose-Datei, die es im Projekt gibt,  einfach mal herunterzuladen. Das kann man hier   08:16
markieren oder hier über diesen Button  'Copy' kopieren und damit 'Ctrl+Shift+V'   08:21
im Terminal einfügen. Jetzt sollte er hier diese  Docker-Compose-Datei schon heruntergeladen haben.   08:26
Das hat er hier gemacht. Ich brauche aber auch  dieses '.env'-File. In diesem '.env'-File werden   08:33
dann meine Konfigurationen definiert. Da werde  ich wahrscheinlich gleich auch noch ein paar   08:38
Änderungen daran vornehmen müssen. Das  habe ich jetzt mal heruntergeladen. Das   08:43
ist dieses '.env'-File. So, das hat er  jetzt gemacht. Populate the '.env'-File   08:47
with custom values. Das müssen wir jetzt  hier definieren. Da müssen wir schauen,   08:53
was wir da einstellen müssen. DB_DATABASE_NAME  und er sagt hier UPLOAD_LOCATION und DB_PASSWORD.   08:57
Das denke ich, sollten wir mal machen. Da  empfiehlt der hier das Utility 'pwgen'. Das   09:04
nutze ich auch sehr gerne. 'pwgen' haben wir jetzt  hier noch nicht drauf. 'sudo apt install pwgen' 09:08
Da muss ich mein Passwort einmal eingeben. 'pwgen'  ist ein Passwortgenerator für die Kommandozeile.   09:18
'pwgen0 und dann kann ich z.B. angeben -n -y  12 oder so etwas. Da könnt ihr euch auch die   09:24
Parameter mal einfach ausgeben lassen. Wenn  ihr da jetzt '--help' angebt, dann seht ihr   09:34
hier z.B. was es da alles für mögliche Parameter  gibt. Also Symbols '-y' ist z.B. Symbole und -n   09:42
ist auch Numbers, also Nummern, und so könnt  ihr halt euer Passwort zusammenbauen. Ich sage   09:51
jetzt hier mal ich nehme jetzt mal das hier oder  ich nehme mal das hier. Das kopiere ich mir mal   09:57
und bearbeite jetzt diese '.env'-Datei mit 'nano  .env' und da gibt es eben dann den DB_USERNAME,   10:08
DB_PASSWORD und dieses Passwort, das solltet ihr  wirklich ändern, das solltet ihr hier nicht auf   10:18
'postgres' stehen lassen, da solltet ihr wirklich  ein eigenes Passwort definieren. Das können wir   10:23
jetzt mit 'Ctrl+O' wirklich wegschreiben und  mit 'Ctrl+X' den Nano wieder beenden. Das ist   10:28
jetzt also vorkonfiguriert und wir könnten jetzt  schon mal anfangen, diese Container zu starten,   10:35
und schauen mal, ob das System tatsächlich so  einfach schon funktionieren würde. Dazu nutze   10:40
ich Docker Compose. Das ist jetzt hier unter  Debian wahrscheinlich immer noch nicht der   10:46
Fall. 'apt-cache search docker-compose. Ja,  das ist separat gehalten. 'sudo apt install   10:55
docker-compose'. Bei neueren Docker-Versionen ist  Docker Compose bereits Bestandteil von Docker.   11:05
Dann macht ihr einfach 'docker compose'. Unter so  einem Debian-System ist das noch separat gehalten.   11:12
Dann müsst ihr 'docker-compose' installieren  und dann wird das dann auch mit 'docker-compose'   11:18
aufgerufen, wie das hier steht. Also da müsst du  dann wirklich ein bisschen aufpassen. Entweder   11:24
Docker Leerzeichen Compose oder Docker Minus  Compose auf einem Debian-System. Ihr könnt auch   11:29
die offiziellen Docker-Pakete von DockerHub  installieren, dann ist es 'Docker Leerzeichen   11:33
Compose'. Im Prinzip ist es das Gleiche, da müsst  ihr euch wirklich keine Sorgen machen. Dann ist   11:38
er jetzt halt hier fertig, das sagt er hier,  glaube ich, sogar. Und dann müsste man noch die   11:44
Post Installation Steps eben durchlesen. Da sollte  man dann nachher hier auf die Webseite zugreifen   11:49
können. Das können wir dann nachher mal probieren,  ob das tatsächlich schon funktionieren würde.   11:55
Da müsste ich dann hier den Port angeben. Die  Applikation läuft standardmässig auf diesem Port   12:01
2283. Dieser Port ist aus dem Internet natürlich  so nicht erreichbar, denn wir möchten das Ganze   12:08
natürlich über HTTP 80 und HTTPS 443 erreichbar  machen, nicht über diesen 2283 Port, das wollen   12:15
wir natürlich nicht. immich ist auch relativ  gross, also das dauert jetzt ein bisschen, bis   12:25
er hier diese ganzen Container gepulled hat und  dann nachher auch gestartet hat. Das ist wirklich   12:30
ganz normal. Wir schauen derweil schon mal in den  Router rein. 192.168.1.1 ist das bei mir, das kann   12:35
aber bei dir auch irgendeine andere IP-Adresse  sein. Wenn du nicht weisst, welche IP-Adresse   12:44
dein Router hat, dann kannst du das auch prüfen  mit 'ip r s', 'ip route show'. Bei dem IP-Kommando   12:51
kannst du immer, wenn das eindeutig ist, einfach  nur den Buchstaben angeben. Also 'ip r s' ist das   12:59
gleiche wie 'ip route show'. 'ip route show' ist  genau das Gleiche. Und hier siehst du dann immer   13:05
'default via' und das ist der Default sogenannte  Default-Gateway. Das heisst, wenn ein Paket nicht   13:12
zugestellt werden kann, also ein Netzwerkpaket,  das ist ganz ähnlich wie mit der Post, dann wird   13:19
es an diese Versandzentrale geschickt und von  dort aus dann weiterverteilt, in dem Fall ins   13:24
Internet. Und das ist halt dieser Default-Gateway,  mein Router 192.168.1.1. Das ist also der hier.   13:31
Meistens haben die kein gültiges Zertifikat,  weil es natürlich eine interne Geschichte ist.   13:38
Da müsst ihr dann eben eine Ausnahme definieren,  um da drauf zuzugreifen. Viele Anbieter machen   13:43
auch so ein Dummy-DNS, also Avahi-MDNS alias. Dann  könnt ihr auch z.B. über so etwas wie yallo.box   13:48
oder fritz.box auf den Router zugreifen. Das ist  auch oft möglich. Schaue ich mal, ob ich darauf 13:58
komme. Da lässt er mich jetzt schon  rein. Dann gucke ich hier unter den   14:06
Netzwerkeinstellungen / NAT mal kurz nach, was  denn da jetzt schon hinterlegt ist. Da ist jetzt   14:15
schon Port und 443 auf meine IP-Adresse. Die haben  wir eben geprüft mit dem Kommando 'ip a s', 'ip   14:22
address show'. Hier bei meinem Netzwerkinterface  192.168.1.140 ist hier richtig angegeben für   14:30
HTTP und HTTPS. Das sollte also auch schon  klappen. Jetzt schauen wir mal, wie weit die   14:40
Applikation hier im Hintergrund schon ist. Ja,  da hat er jetzt 'No Space Left on Device'. Da   14:46
haben wir jetzt die Platte voll. Da reicht ihm  tatsächlich jetzt der Speicherplatz nicht aus.   14:51
Also, du musst halt wirklich schauen, dass du da  ausreichend Speicherplatz hast. Ich schaue mal,   14:58
dass ich hier den Speicher kurz etwas  erweitere. Dazu habe ich euch ja auch   15:05
schon ein Video gemacht und bin gleich wieder  bei dir. Ich konnte in der Zwischenzeit die   15:09
VirtualDisk erfolgreich vergrössern und  jetzt ist die Applikation tatsächlich auch   15:15
bereits gestartet. Prüfen kann ich das auch mit  'docker ps' und da sehe ich hier meine Container.   15:20
mit den veröffentlichten Ports. Das wäre hier  2283. Und wenn ich das Ganze jetzt mal hier   15:28
im Browser eingebe, http ist das jetzt natürlich  noch localhost:2283, dann öffnet sich hier an der   15:35
Stelle auch schon der Willkommensassistent  und ich kann hier die Konfiguration   15:42
vornehmen. Da muss ich als Erstes mal eine  E-Mail-Adresse angeben. astronaut@spacefun.ch. 15:47
Dann noch ein Passwort und das  Ganze dann noch mal bestätigen   15:56
und noch einen Namen 'Astronaut'  und dann kann ich mich hier auch   16:04
schon bereits registrieren. Jetzt hat er das  hier schon eingegeben. astronaut@spacefun.ch, 16:09
mein Passwort und dann kann ich mich  hier schon an dieser App anmelden.   16:20
Hier kann ich dann noch einige Einstellungen  vornehmen, z.B. welches Theme ich haben will,   16:26
ob ich hell oder dunkel haben möchte. Noch  einige Privatsphäre-Einstellungen, dann die 16:30
Speichervorlage und hier auf Fertig klicken.  Und hier kann ich jetzt tatsächlich auch schon   16:37
meine Fotos hochladen und dort in dieser  App meine kompletten Fotos verwalten,   16:44
teilen mit Freunden, Fotobücher anlegen und,  und, und. Ich möchte, dass das Ganze jetzt aber   16:50
natürlich über meine DynDNS-Adresse erreichbar  ist über das Internet. Meine DynDNS-Adresse,   16:57
die heißt tuxwiz.mooo.com und dazu muss ich  als Allererstes dann mal auch ein Zertifikat   17:02
beziehen. Ich nutze jetzt hier als Proxy direkt  den Nginx. Nginx ist eigentlich ein Webserver,   17:09
der auch als Proxy genutzt werden kann, und  den muss ich dazu als Erstes mal installieren. 17:16
sudo apt install nginx 17:24
und das Zertifikat beziehen wir dann  mit dem Certbot. Das machen wir so,   17:32
wie es jetzt hier in der Anleitung vom  Lars auch beschrieben ist. Nginx auf dem   17:38
Host einrichten und wir probieren das Ganze  mal, ob das auch so funktioniert. Also jetzt   17:43
suchen wir erst noch Certbot 'apt-cache search  certbot', weil den brauchen wir natürlich auch 17:48
'sudo install certbot' und dann nehmen wir gleich  auch noch dieses python3-certbot-nginx dazu. Dann   18:01
haben wir auch die entsprechende Konfiguration für  den Nginx dann auch direkt da drin. Und hier hat   18:09
er uns sogar auch schon eine Beispielkonfiguration  erstellt, die wir nachher dann einfach so   18:15
nutzen können. Da müssen wir natürlich einige  Anpassungen vornehmen. Er verwendet jetzt hier   18:22
'certbot certonly'. Dann gibt es eigentlich noch  dieses Nginx-Plugin. Das kann dann für dich deine   18:28
Konfiguration im Nginx vornehmen. Das brauchen wir  eigentlich hier an der Stelle nicht. Wir können es   18:33
trotzdem einmal ausprobieren. Wir sagen einfach  mal 'certbot certonly', dann '--nginx' dann '-d'   18:40
für die Domain. Das wäre jetzt in meinem Fall tuxwiz.mooo.com und wir schauen mal, ob er uns   18:48
denn hier ein Zertifikat beziehen kann. Das Ganze  muss natürlich als Root gemacht werden, also sudo   18:56
davor. Und hier könnte ich jetzt noch eine  E-Mail-Adresse angeben, astronaut@spacefun.ch.   19:02
Für Emergency-Fälle, da stimme ich den Terms of  Usage zu. Dann kann ich hier noch sagen, ob ich   19:11
Informationen teilen möchte. Da sage ich jetzt mal  nein. Und jetzt versucht er hier bereits schon ein   19:20
Zertifikat für mich zu beziehen, im Hintergrund.  Die Nginx-Konfiguration, die müssen wir natürlich   19:25
dann auch gleich noch erstellen. Hier hat er was  gemacht und da sehe ich auch schon die Pfade. Die   19:32
brauchen wir gleich hier. Das sind diese beiden  Pfade, die können wir dann nutzen und in der   19:36
Konfiguration angeben. Ich gebe jetzt hier mal  'sudo bash' ein, damit ich eine Root-Konsole habe   19:41
und die Konfiguration direkt als Root-Benutzer  ausführen kann. Und dazu gehe ich dann in das   19:48
Verzeichnis /etc/nginx. Im /etc/nginx/ gibt es  dann sozusagen ein sites-available, sites-enabled.   19:54
sites-available sind die Seiten, die verfügbar  sind und sites-enabled sind die Seiten, die aktiv   20:03
sind. Also üblicherweise müsste man dann hier  unter sites-available die Site erstellen und die   20:11
dann enablen, und dann kann man in sites-enabled  reingehen und dort macht er dann einen Symlink.   20:18
Das seht ihr jetzt hier auch. Default ist  enabled. Das könnte ich jetzt mal auch disablen.   20:24
Dazu könnte ich jetzt einfach den Link dann  nachher entfernen. Da gibt es auch ein Kommando   20:31
dazu. Das könnt ihr auch ganz einfach machen. Ich  gehe jetzt mal in sites-available und mache jetzt   20:35
eine neue Konfiguration. So wie hier beschrieben.  Da kopiere ich jetzt den ganzen Inhalt und wir   20:41
schauen uns das gleich mal gemeinsam an,  worum es denn da genau im Detail geht.   20:47
Diese Beispielkonfiguration wird  auch so vom Projekt angeboten,   20:55
und ich sage jetzt hier mal als Name z.B.  sites-available, vi und nenne das Ganze jetzt mal 20:59
tuxwiz.mooo.com. Das Ganze könnte man  auch noch .conf nennen. Hier sagt er z.B.   21:08
er lauscht auf Port und dann müsste ich  hier meinen server_name noch angeben.   21:20
Der heißt jetzt hier natürlich tuxwiz.mooo.com 21:25
und hier unten auch server_name 21:34
tuxwiz.mooo.com und hier sind  jetzt diese Zertifikatspfade,   21:42
die hat er uns ja hier ausgegeben. Certificate  ist saved at und das ist die Fullchain,   21:50
die brauchen wir als Erstes hier. Die  ist hier angegeben. Denkt immer daran,   21:55
dass beim Nginx die Konfigurationszeilen immer  mit einem Semikolon abgeschlossen sein müssen,   22:00
sonst kommt er damit nicht klar. Und hier unten  ist dann der Key. Da kann ich jetzt auch noch mal   22:05
den Key hier anpassen. So. Und das sind jetzt  halt SSL-Optionen, die wahrscheinlich durch   22:12
das Certbot-Modul hinzugefügt werden oder in der  Standardkonfiguration so angegeben worden sind.   22:19
Hier sagt er dann jetzt den Proxy, also er  leitet alle Verbindungen dann eben bei uns   22:25
auf localhost auf 2283 weiter. Das ist ja quasi  sozusagen da, wo die Applikation drauf läuft. Da   22:29
sind wir eben auch gewesen. Da konnten wir  schon drauf zugreifen. Nun speichere ich   22:36
das mal. Jetzt gehe ich mal in 'sites-enabled'  und sage jetzt mal 'ln -s' und dann das Ziel. 22:41
../sites-available/tuxwiz.mooo.com.conf und  dann sage ich hier entweder Punkt oder auch   22:57
tuxwiz.moo.com.conf. Und jetzt sollte er hier  diesen Symlink angelegt haben. Den default   23:03
unlinke ich jetzt mit dem Befehl 'unlink'. Da  gibt es aber auch wie gesagt Helferlein dafür. Da   23:09
müsste jetzt nicht mit 'ln' und so arbeiten. Ich  mache das einfach, weil ich dann ganz genau weiß,   23:15
was er da macht. Und jetzt versuchen wir  doch schon mal, den Nginx zu starten. 23:20
systemctl start nginx 23:24
Schauen wir mal, ob der Dienst so heisst. Ja,  der Dienst heisst so und der scheint hier auch   23:33
was gestartet zu haben. Ich könnte jetzt auch  mit netstat wieder prüfen, 'netstat -antp',   23:41
ob da jetzt schon irgendwas läuft. Ja, hier  läuft was auf Port. Und da sagt er jetzt   23:47
auch hier schon, das ist der Nginx Master. Den  hat er aber vorhin schon gestartet. Das heißt,   23:53
das ist immer noch die Standardkonfiguration. Ich  muss also sagen, es ist 'systemct restart nginx'.   23:58
Jetzt sage ich noch mal 'status'. Okay, da hat er  jetzt hier noch ein paar Anmerkungen, die wären 24:03
duplicated, aber scheinbar ist das trotzdem  okay. Und jetzt hat er hier auch auf Port 443   24:10
was laufen. Jetzt versuche ich doch gleich  mal, über tuxwiz.mooo.com aus dem Internet   24:18
sozusagen auf meine Installation zuzugreifen,  und ihr seht, es hat funktioniert. Ich bin hier   24:26
wirklich auch mit Let's Encrypt unterwegs und  kann mich dann auch hier wieder ganz normal mit   24:31
meiner E-Mail-Adresse astronaut@spacefun.ch und  dem von mir vergebenen Passwort an meiner Instanz   24:38
anmelden. Und so habt ihr ganz einfach eure eigene  Fotoverwaltung hier bei euch im Selfhosting direkt   24:46
bei euch in eurem Heimnetzwerk installiert. Falls  ihr da mal irgendwo nicht weiterkommen solltet,   24:54
dann könnt ihr ganz einfach bei uns in der  Community nachfragen. Natürlich auch in den   25:01
Kommentaren hier unter dem Video, aber ansonsten  am besten unter spacefun.ch auf Community klicken   25:05
und dann kannst du hier den QR-Code scannen,  dann bist du direkt im Telegram mit dabei oder   25:12
über XMPP und neu auch über Delta Chat. Darüber  sind wir jetzt erreichbar. Ich freue mich auf   25:17
jeden Fall auf deinen Besuch, dein Feedback  und deine Erfahrung. Bis bald und tschüss. 25:23
Hello fellow spaceflight attendants. When I was young, things like Instagram, Facebook, 00:00
Google Photos, or the like obviously didn't exist. In this video, I want to show you 00:07
how you can host your own photo management system at home. Maybe 00:13
you remember, back then there were things like photo books, the friend books, that looked like this. 00:21
I always really looked forward to them, partly because they had these beautiful horse motifs 00:27
. You could then paste in a photo and tell all sorts of things about yourself. 00:32
We at the Free Software Foundation once put together something similar digitally as a website. 00:39
Unfortunately, it's no longer available online. But you can check it out for yourself. 00:45
It's here on the website notabug.org, and then you can explore here and just search 00:50
for photo book, and then this is my project 'fsfe-zh / fotobuch', and you can 00:56
download it here. You can do it either using this download button or you can copy the 01:06
URL and then clone it here with git. I have git, git clone in the directory here, and then 01:11
I paste this URL in here, and in the background, it's already cloning this photo book. 01:18
I'll show you that in a moment. But today we actually want to install a photo management system, 01:24
and this photo management system is called immich, and I'll show you that in 01:29
detail in a moment. As usual, we'll install the whole thing in Docker using Docker Compose, because then 01:36
it's truly sustainable and we have our system fully under control. 01:42
As usual, I'm using my own Linux distribution as the basis. You can find it here on the website spacefun.ch. I 01:48
usually use the stable edition of Tuxwiz for servers. You can 01:55
download it here once you've submitted a ticket, and it's really, really, really 02:03
good. This version is based on Debian Stable and is very lightweight, but still includes 02:08
a window manager, IceWM. So you can also 02:16
use a graphical interface with it. I usually build my self-hosting projects with VirtualBox. You can, of course 02:23
, also use something like KVM, QEMU, or something similar. Some of you even use Proxmox. 02:29
That's obviously the huge thing; you can work with it too. That's a 02:36
great solution too. I'm using VirtualBox here. If you're using VirtualBox, make sure 02:41
you've set the VM's network settings to bridged mode, because that's the only way 02:46
it's actually assigned an IP address from your local network. It's 02:52
already cloned this Git repository in the background, and I can take a quick look at it. I'd like 02:58
to show it to you again very briefly, though. There's this index.html here, which it 03:03
simply opens in my browser. And here is our free software photo book, in which I 03:08
invited friends to actually post their own pictures here and tell a bit about themselves. 03:13
Registration, of course, only works if the whole thing runs on the web server with PHP mail. 03:18
That's not the case here. And my friends are also pictured here 03:23
, and they always talked a bit about themselves, their favorite projects, and 03:27
what they were so enthusiastic about about free software, and I think that's a really great thing. 03:32
Elias, a very good friend of mine, has sadly passed away since then. But he really immortalized himself in this photo book 03:37
. You can also select the users here, the friends here, 03:43
and you can, of course, expand it yourself and design it for yourself. The whole thing 03:48
is, of course, documented, so you can 03:53
create your own free software photo book together with your friends, or you can commit it here to Git, and we're 03:59
also looking forward to more entries in this photo book. So much for that. I'd now like 04:05
to switch over to my Tuxwiz VM. This is my Spacefun system with LXQt. I'll switch 04:12
over here, and here I already have my Tuxwiz. Lars Müller has 04:18
documented the whole thing quite well on our website gnulinux.ch. There's a documentation here. 04:25
to immich, and we'll use some of that. But I usually start by looking 04:33
at the upstream documentation, i.e., what the project actually describes. 04:40
You'll find that at the end here, the official documentation, and I'll open that first 04:47
. It even recommends using Docker Compose. As usual, 04:52
you need a DynDNS address. Then you need to set the HTTP port, i.e., 04:58
port 80, in your router and forward HTTPS to your virtual machine. You can find your virtual machine's IP address, 05:05
for example, using the 'ip a s' command. That would be this one, and 05:12
you then need to forward the traffic to it. I've explained that in detail in a few other videos. 05:19
Take another look if you're unsure, or just ask me. Here's 05:23
the version with Docker Compose. First, of course, I need Docker. It's 05:29
not installed here yet. So, I'll just say 'sudo apt install docker'. This is 05:33
a Debian system. It should be in the repos. But that's not called 05:39
docker. 'apt-cache search docker' and then I'll see all the packages that contain Docker. And 05:45
I could even add a 'roof symbol' at the front. Then it will 05:54
only show me the packages that have Docker at the beginning. Like this ^ symbol. You 06:00
still have to press space after that, and then it will find these Docker packages that actually 06:05
contain Docker. And the important thing here is this package docker.io, and I'll install it now with 06:11
'sudo apt install docker.io'. And now Docker is already being installed in the background. Docker 06:18
usually always has a group, a 'docker' group, and I want 06:25
to run this software in the user context, not as the root user, as my user. My user is 06:31
'tux' in this case, so I have to 06:36
add this user to this 'docker' group and log out and back in again, otherwise the whole thing won't work. 06:41
To do this, I'll simply create a 'usermod', i.e. sudo usermod -a -G, then the 06:46
group name and my user 'tux'. And now the user 'tux' is already in there. Now I'll log 06:53
out and then log back in again, and that should already be done. 06:58
I can check this with 'id' and then I should 07:09
actually see this 'docker' group here. There it is. Now I'll open the website with the documentation again 07:14
so we can work our way through it. So here was the immich documentation. I 07:21
'll say it again here, though, I'll also open our website with the article by Lars 07:27
Müller. Then we can take another look at that. So 07:34
, the first thing it tells me to do is download the necessary files. It recommends, 07:39
for example, creating a directory called immich-app in the folder where I am right now. I 07:44
am now in my home directory. I can check that with 'pwd'. I'll do that now 07:50
. mkdir ./immich-app creates the directory exactly where I am now. Now 07:55
I simply say 'ls', just 'ls', and I can see that the directory 08:02
has been created here. I'll go there now, and then it recommends that I 08:09
simply download this Docker Compose file that's in the project. You can 08:16
select it here or copy it using the 'Copy' button and then paste it into the terminal with 'Ctrl+Shift+V' 08:21
. It should have already downloaded this Docker Compose file. 08:26
It's done that here. But I also need this '.env' file. 08:33
My configurations are defined in this '.env' file. I'll probably have to make a few changes to it soon 08:38
. I've downloaded it now. This 08:43
is this '.env' file. So, it's done that. Populate the '.env' file 08:47
with custom values. We need to define that here. We need to see 08:53
what we need to set there. DB_DATABASE_NAME and it says UPLOAD_LOCATION and DB_PASSWORD. 08:57
I think we should do that. He recommends the utility 'pwgen'. 09:04
I like using that too. We don't have 'pwgen' installed here yet. 'sudo apt install pwgen' 09:08
I have to enter my password once. 'pwgen' is a password generator for the command line. 09:18
'pwgen0' and then I can enter -n -y 12 or something like that. You can also 09:24
have the parameters displayed there. If you enter '--help' you can see 09:34
what possible parameters there are. For example, Symbols '-y' is symbols and -n 09:42
is numbers, and that's how you can put your password together. I'll say 09:51
I'll use this or I'll use this. I'll copy that 09:57
and edit this '.env' file with 'nano .env'. There you'll find the DB_USERNAME, 10:08
DB_PASSWORD, and this password. You really should change that. You shouldn't 10:18
leave it set to 'postgres'; you really should define your own password. We can 10:23
now delete that with 'Ctrl+O' and quit Nano with 'Ctrl+X'. So it's 10:28
preconfigured now, and we can start starting these containers 10:35
and see if the system actually works that easily. 10:40
I'm using Docker Compose for that. That's probably still not the case here under Debian 10:46
. 'apt-cache search docker-compose. Yes, it's kept separate. 'sudo apt install 10:55
docker-compose'. In newer Docker versions, Docker Compose is already part of Docker. 11:05
Then you simply do 'docker compose'. On a Debian system, it's still kept separate. 11:12
You then have to install 'docker-compose', and then it's 11:18
called with 'docker-compose', as it says here. So you really have to be a bit careful there. Either 11:24
Docker Space Compose or Docker Minus Compose on a Debian system. You can also 11:29
install the official Docker packages from DockerHub, in which case it's 'Docker Space 11:33
Compose'. It's basically the same, so you really don't have to worry about it. Then 11:38
it's finished here, I think it even says so. And then you have to 11:44
read through the post-installation steps. Then you should be 11:49
able to access the website here later. We can try that later to see if it actually works. 11:55
I would then have to specify the port here. By default, the application runs on port 12:01
2283. This port is, of course, not accessible from the internet, as we want to 12:08
make the whole thing accessible via HTTP 80 and HTTPS 443, not port 2283. 12:15
We don't want that, of course. The immich is also relatively large, so it will take a while until 12:25
it pulls all these containers and then starts them up. That's 12:30
completely normal. In the meantime, let's take a look at the router. It's 192.168.1.1 for me, 12:35
but it could be any other IP address for you. If you don't know 12:44
your router's IP address, you can check with 'ip r s', 'ip route show'. With the IP command, 12:51
you can always just specify the letter if it's unique. So 'ip r s' is the 12:59
same as 'ip route show'. 'ip route show' is exactly the same. And here you always see 13:05
'default via', and that is the default gateway. This means that if a package cannot 13:12
be delivered, a network package, which is very similar to the mail, then 13:19
it is sent to this dispatch center and then forwarded from there, in this case to 13:24
the internet. And that is the default gateway, my router 192.168.1.1. So this is the one here. 13:31
Most of the time they don't have a valid certificate because it's an internal matter, of course. 13:38
You have to define an exception to access it. Many providers 13:43
also use a dummy DNS, the Avahi-MDNS alias. Then you can also access the router via something like yallo.box 13:48
or fritz.box. That's often possible, too. I'll see if I can 13:58
I'm coming. It's letting me in now. Then I'll 14:06
quickly check under Network Settings / NAT what's already stored there. 14:15
Port 443 is already set to my IP address. We just checked that with the command 'ip a s', 'ip 14:22
address show'. Here on my network interface 192.168.1.140 is correctly specified for 14:30
HTTP and HTTPS. So that should work. Now let's see how far the 14:40
application has progressed in the background. Yes, it now has 'No Space Left on Device'. 14:46
The disk is full now. It actually doesn't have enough storage space. 14:51
So, you really have to make sure you have enough storage space. I'll see 14:58
if I can expand the memory a bit. I've 15:05
already made a video for you about that and will be back with you in a minute. In the meantime, I was able to successfully enlarge the 15:09
VirtualDisk, and the application has actually 15:15
already started. I can also check this with 'docker ps' and there I can see my containers 15:20
with the published ports. That would be 2283 here. And if I now enter the whole thing here 15:28
in the browser, http which is of course still localhost:2283, the welcome wizard 15:35
opens here and I can configure it here 15:42
. First I have to enter an email address: astronaut@spacefun.ch. 15:47
Then a password and then confirm the whole thing 15:56
and a name 'Astronaut' and then I can 16:04
register here. Now he has already entered this here: astronaut@spacefun.ch, 16:09
my password and then I can log in to this app. 16:20
Here I can then adjust a few more settings, e.g. which theme I want, 16:26
whether I want it light or dark. Some more privacy settings, then the 16:30
storage template and click Finish. And here I can now actually 16:37
upload my photos and manage all my photos in this app, 16:44
share them with friends, create photo books, and so on. I would like the whole thing 16:50
to be accessible via my DynDNS address on the internet, of course. My DynDNS address 16:57
is tuxwiz.mooo.com, and for that the very first thing I need to do is 17:02
get a certificate. I'm using Nginx as the proxy here. Nginx is actually a web server 17:09
that can also be used as a proxy, and the first thing I need to install is 17:16
sudo apt install nginx 17:24
, and then we'll get the certificate with Certbot. We'll do this as 17:32
described in Lars' instructions here. 17:38
Set up Nginx on the host and we'll try it out to see if it works that way. So now 17:43
we first search for Certbot 'apt-cache search certbot', because we obviously need that as well. 17:48
'sudo install certbot'. Then we also add this python3-certbot-nginx. Then 18:01
we also have the corresponding configuration for Nginx right there. And 18:09
it's even created a sample configuration for us here, which we can simply use later 18:15
. We'll have to make a few adjustments, of course. It's using 18:22
'certbot certonly' here . Then there's this Nginx plugin. It can then 18:28
configure your Nginx for you. We don't really need that here, but we can try it 18:33
out anyway. We simply say 'certbot certonly', then '--nginx', then '-d' 18:40
for the domain. In my case, that would be tuxwiz.mooo.com, and we'll see if it 18:48
can retrieve a certificate for us. The whole thing has to be done as root, of course, so 18:56
preceded by sudo. And here I could also enter an email address, astronaut@spacefun.ch. 19:02
For emergency cases, I agree to the Terms of Usage. Then I can also indicate here whether I 19:11
want to share information. I'll say no to that. And now it's already trying 19:20
to get a certificate for me, in the background. We have to configure the Nginx, of course. 19:25
Then create it right away. It's done something here, and I can already see the paths. 19:32
We'll need them right here. These are the two paths we can use and 19:36
specify in the configuration. I'll now type 'sudo bash' so I have a root console 19:41
and can run the configuration directly as the root user. And to do this, I'll go to the 19:48
/etc/nginx directory. In /etc/nginx/ there's a sites-available, sites-enabled directory. 19:54
Sites-available are the available pages, and sites-enabled are the active pages 20:03
. So normally, you would have to create the site here under sites-available and 20:11
then enable it. Then you can go to sites-enabled, and it creates a symlink there. 20:18
You can see that here too. The default is enabled. I could also disable that now. 20:24
I could simply remove the link later. There's a command 20:31
for that, too. You can do that quite easily. I'm now going to go to sites-available and create 20:35
a new configuration, as described here. I'm going to copy the entire contents, and we 20:41
'll take a look at what it's all about in detail. 20:47
This example configuration is also provided by the project, 20:55
and I'll give it a name like sites-available, vi, and call the whole thing 20:59
tuxwiz.mooo.com. You could also call the whole thing .conf. Here it says 21:08
it's listening on port, for example, and then I need to enter my server_name. 21:20
This is of course called tuxwiz.mooo.com 21:25
, and below this is also server_name 21:34
tuxwiz.mooo.com, and here are the certificate paths 21:42
that it gave us. Certificate is saved at, and this is the full chain; 21:50
we need that first. It's specified here. Always remember 21:55
that with Nginx, configuration lines must always end with a semicolon, 22:00
otherwise it won't be able to handle it. And below this is the key. I can now adjust the key again 22:05
here. So. And these are SSL options, which are probably 22:12
added by the Certbot module or specified in the default configuration. 22:19
Here it then specifies the proxy, so it 22:25
forwards all connections on our localhost to 2283. That's basically where the application is running. 22:29
We were there just now. We were able to access it. Now I'll save 22:36
this. Now I'll go to 'sites-enabled' and say 'ln -s' and then the target: 22:41
../sites-available/tuxwiz.mooo.com.conf and then I'll say either a period or 22:57
tuxwiz.moo.com.conf. And now it should have created this symlink. 23:03
I'll unlink the default with the 'unlink' command. But as I said, there are also little helpers for that. You 23:09
don't have to work with 'ln' and such. I'll just do that because then I know exactly 23:15
what it's doing. Now let's try starting Nginx. 23:20
systemctl start nginx 23:24
Let's see if that's the name of the service. Yes, that's the name of the service, and it seems 23:33
to have started something here too. I could also check again with netstat, 'netstat -antp', 23:41
to see if anything is already running. Yes, something is running on port 1. And it's already saying 23:47
this is the Nginx master. But it already started that earlier. That means 23:53
it's still the default configuration. So I have to say 'systemct restart nginx'. 23:58
Now I'll say 'status' again. Okay, it has a few more comments here, which would be 24:03
duplicated, but apparently that's still okay. And now it also has 24:10
something running on port 443. Now I'll try 24:18
accessing my installation from the internet, so to speak, via tuxwiz.mooo.com, and you can see it worked. I'm 24:26
actually using Let's Encrypt here, and I can log in 24:31
to my instance as usual with my email address astronaut@spacefun.ch and the password I've assigned 24:38
. And so you can easily manage your own photo management right here on your self-hosting platform. 24:46
installed on your home network. If you ever get stuck, 24:54
you can simply ask us in the community. Of course, you can also use the 25:01
comments below the video, but otherwise, the best way is to click on Community at spacefun.ch 25:05
and then scan the QR code. You'll then be connected directly via Telegram or 25:12
via XMPP and, now, also via Delta Chat. You can now reach us via that. I look forward 25:17
to your visit, your feedback, and your experience. See you soon and goodbye. 25:23

Verwalte deine Fotos mit immich auf deinem eigenen Homeserver!

In diesem Video zeige ich dir Schritt für Schritt, wie du die Software immich auf deinem Selfhosting-Server installieren kannst. Mit dieser Anleitung kannst du deine Fotos ganz einfach verwalten und mit Freunden teilen, ohne auf externe Dienste wie Google Fotos zurückgreifen zu müssen.

Was du lernen wirst:

- Installation von immich auf deinem Homeserver

- Nutzung von Docker und Docker Compose für eine nachhaltige Lösung

- Einrichtung eines NGINX Proxyservers

- Let's Encrypt Zertifikat für eine sichere Verbindungen

Mit immich hast du die volle Kontrolle über deine Daten und kannst deine Fotos sicher und privat verwalten. Lass uns gemeinsam starten!

Links und Ressourcen:

- immich GitHub Repository: https://github.com/immich-app/immich

- Anleitung auf GNU/Linux.ch https://gnulinux.ch/immich-mit-docker-compose-installieren

Navigation

Video Player