This tutorial will explore the download and installation of Docker and Nextcloud. There are many benefits to having a home server or home lab. It can create render many different services and features and a new paradigm shift in how to view technology and navigation of the internet. Docker allow a server to have multiple purposes and offer different features. Virtual Machine and Docker equivalent in in functionality of enabling the server to be versatile in the range of offering different services. However, docker can be more beneficial because freedom, flexibility and hardware dynamics. The virtual machine are allot static hardware capacity and this is where diverges it diverges from docker. Virtual machine have has it's own finite hardware specifications that pulls from the actual system's resources. It has it’s kernel, operating system and system settings. Docker dynamically shares hardware resources through the kernel of the operating system that is actually installed on the server. The docker creates a container, it is sand boxed from the rest of the system, but the container is dependent on the kernel which is able access the hardware resources.
Nextcloud is an open-sources cloud environment with many different functionality and feature rich. It can serve as a cloud back up service, calendar, contacts backup, notes, file sharing. There is many other functionalities such has having a cloud based office suite that can be connected to the instanced to being able to dynamically work on documents or a spreadsheet. It even has the capability of perform video calling or instant messaging. It is a very versatile software program.
This tutorial's aim is to provide commands and docker compose in order to successful install Nextcloud onto the home server using Fedora 44 server operating system.
The installation of docker and nextcloud will be set up only on the private network, not publicly accessible for the time being. More than likely this tutorial will be updated over time with a comprehensive view. There will be screenshot to show what will transpire after the commands are typed in. Also, for simplicity you can copy and paste the commands the docker compose file in order to simple the process. Nextcloud can rather be difficult to install and setup so hopefully this tutorial will be comprehensive enough to install it on the Fedora server.
sudo dnf install -y docker docker-compose
The "-y" flagging means yes to downloading of the required packages and necessary dependencies. You will be prompted to type in your password and followed by pressing enter. The download and installation process will commence.
sudo systemctl start docker && sudo systemctl status docker
You will be prompted to type in your password followed by pressing the enter button on the keyboard.
In the screenshot above, we are looking to see if the system daemon is active which is in a green font color. Press "ctrl + C" to exit.
mkdir –p ~/Docker/Nextcloud && cd ~/Docker/Nextcloud
This command will create the the parent directory with child directories and will change directory into the ~/Docker/Nextcloud. The "-p" flagging represent the parent directory as in it will create the pathway provided.
sudo nano docker-compose.yml
Now using nano text editor within the terminal will be opened up.
---
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- MYSQL_PASSWORD=Set_this_password!! #change this password for the sql
database
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
links:
- mariadb
volumes:
- ~/Docker/Nextcloud/config:/config #change the pathway of the directory
if necessary
- ~/Docker/Nextcloud/data:/data #change the pathway of the directory
if necessary
ports:
- 443:443 # change the internal to something else. The internal port is
the 443 for the container
restart: always
mariadb:
image: linuxserver/mariadb
container_name: mariadb2
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=Set_this_Password!! #change this password for the
root password of the maria database
- TZ=America/”New York” #set the timezone to your timezone
- MYSQL_PASSWORD=Set_this_password!! #this password should be the same
as the above in the nextcloud instance
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
volumes:
- ~/Docker/Nextcloud/mariadb:/config #change the pathway if necessary
ports:
- 3306:3306 #leave this port alone unless it interferes with another container.
restart: always
After copy and pasting, the code. Press "ctrl + x" to exit the file then press "Y" meaning yes to save the file and press enter to keep the file name the same and will be closed out.
cat docker-compose.yml
mkdir mariadb config data
Pressing enter after the command is typed in shows no feedback means the command was successfully executed.
sudo docker compose up -d
The "-d" flagging will hide the all of the background installation and will present a clean screen install. If prompted to type in the password do so and press the "enter" button on the keyboard.
sudo docker ps
ip addr show
The command will show all of the internet connection and convey which ones are active. Depending on how you are trafficking the internet you will see either “enp” state is “UP” which means the ethernet is connected to the server and this will provide the local ipv4 or inet which is the private network IP address that will be used to navigate to the nextcloud instance. If the device is connected through wifi you should see wlp state is "UP" which means the device is connected to the wifi. Either way you are wanting to retrieve the inet which is the IPV4 address which usually begins with 192.168.000.000. For security reasons, no photo will be provided for this step due to security reasons.
https://192.168.000.000:443
Replace the URL with you private IPV4 address followed by the port.
This screenshot above is what it should look like for the first time navigation on the private network. However, you will need to submit your information and create an user. This tutorial will be amended over time to show a more in depth view to have the Nextcloud be accessible on the public network which will include Nginx proxy manager and portainer for container management.