diff --git a/content/posts/Using an old laptop to create a Nextcloud and Plex server.md b/content/posts/Using an old laptop to create a Nextcloud and Plex server.md index c01fe34..acfa350 100644 --- a/content/posts/Using an old laptop to create a Nextcloud and Plex server.md +++ b/content/posts/Using an old laptop to create a Nextcloud and Plex server.md @@ -13,6 +13,7 @@ I also want to use Nextcloud to backup other cloud services that I use, includin ## Prepping the laptop to run as a server ### Install ubunutu server, change default behaviours and mount the drive +First, after doing a fresh install of [Ubuntu server 22.04](https://ubuntu.com/download/server#downloads) I need to change the behaviouf of the laptop to be more server-esque. As it will be sitting closed on a desk, the sleep, suspend and laptop close switch behavior needs to be modified. ``` sudo apt update -y && sudo apt upgrade -y @@ -22,10 +23,16 @@ sudo service systemd-logind restart ``` ### Set a static IP for the server +Static IP is assigned in my router's DHCP settings. +It's worth noting that as I was using a residential IP, I needed to pay an additional £5 a month to get a static IP set. This way I could successfully port forward using the steps below. Otherwise the portforwarding settings will not work as they un-resolvable with all the other routers using the shared IP address. ### Enable portforwarding on the router +Once again from the router admin settings. Port forwarding needs to be set. [Noip](https://www.noip.com/support/knowledgebase/general-port-forwarding-guide) has a useful guide for this. ### Firewall settings on the server +For [Nextcloud](https://help.nextcloud.com/t/what-are-ports-80-443-3478-8080-8443-in-nc-aio-used-for/172557#:~:text=Additionally%2C%20ports%2080%2C%208080%2C,used%20for%20the%20Apache%20server.) Ports 80 and 8443 need to be open. Port 80 is used for the interface and 8443 is used for the talk service. For [Plex](https://support.plex.tv/articles/201543147-what-network-ports-do-i-need-to-allow-through-my-firewall/)32400 is used for communication and is enough to get started with. + +Ubuntu server comes with [ufw](https://wiki.ubuntu.com/UncomplicatedFirewall) and is easy to use on the command line to open up these ports. ``` #enable ufw, allow ssh and restart the service sudo ufw enable @@ -40,6 +47,7 @@ sudo systemctl restart ssh ``` ### Install docker +Simply follow the latest docker docs to install docker. Docker was also removed from snap packages as this was causing an issue later in the install. ``` # Add Docker's official GPG key sudo apt-get update @@ -63,15 +71,20 @@ reboot ``` ### Add noip client for dynamic DNS -Follow noip's configuration guide for setting up the dynamic dns client on the laptop. +Follow noip's configuration guide for setting up the dynamic dns client on the laptop. I'm not sure this is entirely necessary as a static IP was set earlier. But in future it might be useful if I want to keep the server using DHCP. No-ip can then update this so it is always accessible. ### Install Nextcloud AIO +Nextcloud has some good docs for installing their [all-in-one](https://github.com/nextcloud/all-in-one) (aio) docker container. It saves alot of configuring from a fresh install. + +Once it is installed go through the steps to qualify the domain, though this can be skipped using `-e SKIP_DOMAIN_VALIDATION=true` as this can cause issues I have found. ``` #Install nextcloud-aio using docker sudo docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always --publish 80:80 --publish 8080:8080 --publish 8443:8443 --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro nextcloud/all-in-one:latest ``` ### Install Plex +I used the docker method of installing [Plex](https://pimylifeup.com/plex-docker/) so I can easily manage that along with nextcloud. + ``` #Create a compose.yml file to use with docker compose vi /opt/stacks/plex/compose.yml @@ -105,10 +118,3 @@ cd /opt/stacks/plex/ docker compose up -d ``` - - -#programming -#nextcloud -#plex -#obsidian -