- Run the following code:
sudo apt update && sudo apt upgrade
- Switch to root user and enter the root password
su root
- Access the sudoers file
sudo visudo
- locate the section for User Privilleges and your user
# User privilege specification
root ALL=(ALL:ALL) ALL
<your username> ALL=(ALL) NOPASSWD: ALL
Step 3: Install ssh server
- Run the following code:
sudo apt install openssh-server
- Determine the Ip address of the machine (here the ip address is 192.168.1.36) and connect to it via ssh
ip a
example output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:cf:33:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.1.36/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3
valid_lft 85944sec preferred_lft 85944sec
inet6 fe80::a00:27ff:fecf:33ac/64 scope link noprefixroute
valid_lft forever preferred_lft forever
example output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:cf:33:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.1.36/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3
valid_lft 85944sec preferred_lft 85944sec
inet6 fe80::a00:27ff:fecf:33ac/64 scope link noprefixroute
valid_lft forever preferred_lft forever
- Open a terminal window on the other machine and write
ssh <username>@<the device ip>
##example:
ssh [email protected]
## you will be prompted to enter a password, enter the password of the user you are connceting to
- Open the SSH daemon configuration file
sudo nano /etc/ssh/sshd_config
- Locate the premit root login and turn it to "no"
# How it might look
PermitRootLogin yes
# After changing value
PermitRootLogin no
- Run the following code to install docker:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --dry-run
- Test your docker installation
sudo docker run hello-world
- Install the latest version of docker compose and verify that it is installed
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- Add your user to the docker group
sudo usermod -aG docker <username> # add the user tp the docker group
su - <username> # log out and log back in
groups # verify by making sure that docker shows up when you run this command
- Create a nextcloud directory (The directory structre is optional) and create a docker-compose yaml file
mkdir docker && cd docker && mkdir nextcloud && cd nextcloud && nano docker-compose.yml
- Write this into the yml file ( change the passwords )
version: '3'
services:
nextcloud:
image: nextcloud
container_name: nextcloud
restart: unless-stopped
ports:
- 8080:80 # Change the port if port 8080 is already used up
volumes:
- ./nextcloud:/var/www/html
environment:
- MYSQL_HOST=mysql
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=test123 # Change this password
depends_on:
- mysql
mysql:
image: mysql:5.7
container_name: mysql
restart: unless-stopped
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=test123 # Change this password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=test123 # Change this password
volumes:
db:
-
Run The container
docker-compose up -d
-
Open it in the browser and create the username and password for the main user
http://<the server IP address>:8080 #change the port if you changed it in the compose filr
- Choose If you want to install thier extra apps or not