____ ________ / __ \___ _ __/ ____/ /_ ___ _ __ / / / / _ \ | / / / / __ \/ _ \ | /| / / / /_/ / __/ |/ / /___/ / / / __/ |/ |/ / /_____/\___/|___/\____/_/ /_/\___/|__/|__/

HomeLab Server

What i try to do

Create homelab server with nas, cloud storage, and home-assistant

What hardware i use

HP ProLiant MicroServer N36L adata 1tb ssd for os random 2tb hdd for files - with plan to replace it with 3 10tb hdd's

TLDR;

- Install OpenMediaVault
- Change default passord
- Install updates
- OMV-Extras
- Proxmox kernel
- install zfs
- configure storage
- Docker
- Portainer
- Setup portainer
- Create owncloud stack
- Create home-assistant stack

Install OpenMediaVault

Simply follow instructons from https://docs.openmediavault.org/en/latest/installation/via_iso.html In my case i set Hostname to homeserver, and Domain name to local

After that Open browser and go to homelab.local

Login with login admin and password openmediavault And, change default admin password

Next its good to install any updates. From sidebar, go to System > Update Managment > Updates Then click on magiier glass, to fetch any updates, and then click on download button do download and install all of them.

Initial instalation complete

OMV-Extra

Omv-extra is a set of plugins for openmediavault.

Always referr to official guide for installing process https://wiki.omv-extras.org/doku.php?id=misc_docs:omv_extras

We need to: - Login to ssh - Run wget command from manual wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash - Done

Proxmox kernel

First install Proxmox kernel, its necessary, becouse this kernel has support for zfs build in, and we need it.

Go to System > Plugins and add "openmediavault-kernel" plugin

Now in the System > Kernel menu, install proxmox kernel, i chose newest avalible 6.2

Select Proxmox option

and chose install proxmox 6.2

After that restart server

After reboot you can get back to kernel plugin page and in the same menu chose "remove non proxmox kernels" since we dont need it. Or leave it as i do

Discs and ZFS

ZFS is filesystem, something like RAID but with superpowers. Go to plugins and install "openmediavault-zfs" from plugins page

Go to System > Discs Configure drives you want to use. One by one click on each disc, format it I have mechanic drives and want to reduce power consumption, so i set spindown, to do that select drive and pres pencil button. in Power managment, select 1 Spindown time to 5 minutes Then Save

Go to Storage > ZFS > Pools Then + to add new pool

Set a name, can be anythng, but for convenience keep the name lovercase, and without whitespaces Chose Type, For One drive chose Basic, if you have 3 discs chose RAID-Z1 it will give you one rednundant drive. Add drives, Save

Docker

Install Docker Go to system > omv-extras > docker, and click install

Portainer

Install portainer Go to system > omv-extras > portainer, and click install Now click on open web and do initial configure Simply create login and password for admin and hit create user

Now connect to docker insance. Click on "Get started Proceed using local envirnoment…"

Now click on home from sidebar, click on the pencil icon on your envirnoment tile Add public ip, in my case its homelab.local Click update

owncloud

Now there is two options, one with data stored on main os srive, and second where data is store in other location.

Option 1 - data on os drive

Open portainer You can do that from system > omv-extras > portainer > open web Open envirnoment, and go to Stacks on sidebar Click Add Stack

Name: ownCloud Build method: Repository Repository URL: https://github.com/owncloud/docs-server/ Repository reference: [empty] Compose path: modules/admin_manual/examples/installation/docker/docker-compose.yml Environment variables: switch to advanced Paste from decumentation https://doc.owncloud.com/server/10.12/admin_manual/installation/docker/#docker-compose from section with env files, for example

OWNCLOUD_VERSION=10.12
OWNCLOUD_DOMAIN=localhost:8080
OWNCLOUD_TRUSTED_DOMAINS=localhost
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=8080

Change domain and port to yours in my case

OWNCLOUD_VERSION=10.12
OWNCLOUD_TRUSTED_DOMAINS=homelab.local
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
OWNCLOUD_DOMAIN=192.168.10.200:9090
HTTP_PORT=9090

Click on Deploy stack

Option 2

We need to prepare data drive

Login via ssh, and then

cd /
ls

There should be folder with the same name as your zfs pool I name mine bigdaddy, co i continue with

cd bigdaddy
mkdir owncloud/data -p

And thats it

Open portainer You can do that from system > omv-extras > portainer > open web Open envirnoment, and go to Stacks on sidebar Click Add Stack Name: owncloud Build method: Web editor Content:

version: "3"

volumes:
  files:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ${FILES_PATH}
  mysql:
    driver: local
  redis:
    driver: local

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION}
    container_name: owncloud_server
    restart: always
    ports:
      - ${HTTP_PORT}:8080
    depends_on:
      - mariadb
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
      - OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=mariadb
      - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
      - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - OWNCLOUD_MYSQL_UTF8MB4=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - files:/mnt/data

  mariadb:
    image: mariadb:10.6 # minimum required ownCloud version is 10.9
    container_name: owncloud_mariadb
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=owncloud
      - MYSQL_USER=owncloud
      - MYSQL_PASSWORD=owncloud
      - MYSQL_DATABASE=owncloud
    command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - mysql:/var/lib/mysql

  redis:
    image: redis:6
    container_name: owncloud_redis
    restart: always
    command: ["--databases", "1"]
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - redis:/data
      

Environment variables: switch to advanced And paste values:

OWNCLOUD_VERSION=10.12
OWNCLOUD_TRUSTED_DOMAINS=homelab.local
ADMIN_USERNAME=admin
ADMIN_PASSWORD=adminpass
OWNCLOUD_DOMAIN=192.168.10.200:9090
HTTP_PORT=9090
FILES_PATH=/bigdaddy/owncloud/data/

Pay attention to Admin_Password, chenge it to stron password Piles_path shoud be the path to your drive, simply change bigdaddy to your zfs poll name

Deploy stack

After redirect you can verify if stack is running Click on its name, scroll to container and check is everything has status running If yes, then you can log in into owncloud. Click on port from container "owncloud_server", published Ports section

If you see message "You are accessing the server through an untrusted domain." thats means that, you put different domain name in OWNCLOUD_TRUSTED_DOMAINS env variable. Try accesing site from that domain or change it to ip adress of server and restart stack.