Difference between revisions of "Getting Started with OpenMediaVault"
(updated by API) |
(updated by API) |
||
Line 1: | Line 1: | ||
[[Getting Started with OpenMediaVault/zh|查看中文]] | [[Getting Started with OpenMediaVault/zh|查看中文]] | ||
+ | ==OpenMediaVault version== | ||
+ | * OS: Debian 11<br /> | ||
+ | * OpenMediaVault: 6.9.0-1 (Shaitan)<br /> | ||
+ | * Docker: 24.0.6<br /> | ||
+ | * Others: built-in OMV-Extras and openmediavault-compose<br /> | ||
+ | ==Supported platforms== | ||
+ | * RK3328<br /> | ||
+ | * RK3399<br /> | ||
+ | * RK3568<br /> | ||
+ | * RK3588<br /> | ||
+ | ==Find IP Address== | ||
+ | |||
+ | Since the hostname is set by default to the model of the development board, you can use the "ping" command to obtain the IP address. For example, for NanoPi-R2C, you can use the following command: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | ping NanoPi-R2C | ||
+ | </syntaxhighlight> | ||
+ | ==Access the OpenMediaVault web page== | ||
+ | Enter the IP address of the development board in your web browser; the default login account for the web interface is: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Username: admin | ||
+ | Password: openmediavault | ||
+ | </syntaxhighlight> | ||
+ | ==Change the web login password== | ||
+ | Click on the profile picture in the upper-right corner of the web page, then select "Change Password" | ||
+ | ==Configure the web page timeout duration== | ||
+ | Navigate to "System" -> "Workbench" and adjust the "Auto Logout" time setting. | ||
+ | ==Logging in via SSH== | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | ssh pi@YourIPAddress | ||
+ | </syntaxhighlight> | ||
+ | The default password is "pi". | ||
+ | ==Create the root user== | ||
+ | Create the root user and add user to the root and ssh groups: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | sudo passwd root | ||
+ | sudo gpasswd -a root root | ||
+ | sudo gpasswd -a root ssh | ||
+ | </syntaxhighlight> | ||
+ | You can now use the root user to log in via SSH: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | ssh root@IPAddress | ||
+ | </syntaxhighlight> | ||
+ | ==Configure the hard drive and shared folders== | ||
+ | (Note: If the hard drive has already been initialized and RAID has been preserved, you can proceed directly to step four for mounting.) | ||
+ | ===Step One: Initialize the storage device (Optional)=== | ||
+ | Navigate to "Storage" -> "Disks," select your storage device, and click the "Wipe" icon to perform disk erasure (please ensure your data is backed up). Typically, you can choose "Quick" erase. | ||
+ | ===Step Two: Create RAID (Optional)=== | ||
+ | (Note: USB interface hard drives are not supported, and OpenMediaVault will not list USB storage devices on the RAID creation page.)<br /> | ||
+ | Go to "Storage" -> "Software RAID" click the "+" icon, choose the RAID level, and apply the settings. | ||
+ | ===Step Three: Create File System (Optional)=== | ||
+ | Go to "Storage" -> "File Systems," click on the "+" icon, and for the type, it's recommended to choose "BTRFS." Select "Single" and check the storage device. If you created a RAID in the previous step, choose a device starting with /dev/md. If it's a USB hard drive, choose /dev/sda. | ||
+ | ===Step Four: Mount the File System=== | ||
+ | Go to "Storage" -> "File Systems," click the ">" icon for mounting existing file systems, and choose the device you want to mount. | ||
+ | ===Step Five: Add Shared Folders=== | ||
+ | Go to "Storage" -> "Shared Folders," click the "+" icon to create two folders named "nfs" and "samba." We will use these folders for testing NFS and Samba sharing in the following steps.<br /> | ||
+ | (Note: If there were previously created shared folders on the hard drive, you can recreate them with the same names, and the data will be preserved.) | ||
+ | ==Create NAS users== | ||
+ | Debian system users or Linux users created via the command line may lack certain permissions required for services like Samba and NFS. Therefore, it is recommended to use the OpenMediaVault interface to create a user specifically for accessing Samba and NFS shares. Here, I will create a user and group named "nasuser":<br /> | ||
+ | <br /> | ||
+ | Click on "Users" -> "Groups" and then click the "+" icon to create a user group named "nasuser".<br /> | ||
+ | Click on "Users" -> "Users" then click the "+" icon to create a user named "nasuser", change user's shell to "/usr/sbin/nologin", and select the "nasuser" and "users" groups. | ||
+ | ==Create a Samba share== | ||
+ | Go to "Services" -> "SMB/CIFS" -> "Settings," check the box at the top for "Enabled," select "SMB1" as the minimum protocol version, and then click "Save"<br /> | ||
+ | <br /> | ||
+ | Go to "Services" -> "SMB/CIFS" -> "Shares," click the "+" button, and in the "Shared folder" field, select the folder you want to share. as an example, here i select the "samba" folder<br /> | ||
+ | <br /> | ||
+ | Testing: <br /> | ||
+ | On Mac system, right-click Finder, select "Connect to Server," and enter "smb://YourIPAddress" (replace with the actual IP address). A authentication dialog will appear; enter the username "nasuser" and the password to access the share. | ||
+ | ==Create an NFS share== | ||
+ | Go to "Services" -> "NFS" -> "Settings" check the box at the top for "Enabled", and in the "Versions" section, select all versions, including "NFSv2", then click "Save" and apply the settings.<br /> | ||
+ | <br /> | ||
+ | Go to "Services" -> "NFS" -> "Shares," click the "+" button, and in the "Shared folder" field, select the folder you want to share. here i select the "nfs" folder. In the "Client" section, enter the IP range or specific IPs that are allowed to access the share (e.g., 192.168.1.0/24). Set the permissions to "Read/Write", in the "Extra Options" field, Input: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | rw,async,insecure,no_subtree_check,all_squash,anonuid=0,anongid=0 | ||
+ | </syntaxhighlight> | ||
+ | Then click "Save" and apply the settings. | ||
+ | ===Testing NFS mounting on a Mac=== | ||
+ | Viewing OpenMediaVault's NFS Share Information via Command Line | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | # showmount -e YourIPAddress | ||
+ | Exports list on YourIPAddress: | ||
+ | /export 192.168.1.0/24 | ||
+ | /export/nfs 192.168.1.0/24 | ||
+ | </syntaxhighlight> | ||
+ | Right-click Finder on your Mac, select "Connect to Server," and in the address bar, input: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | nfs://YourIPAddress/export/nfs | ||
+ | </syntaxhighlight> | ||
+ | ===Testing NFS mounting on Linux=== | ||
+ | Installing the NFS client | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | sudo apt install nfs-common | ||
+ | </syntaxhighlight> | ||
+ | Start to mount: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | sudo mount -t nfs YourIPAddress:/export/nfs /mnt/nfs | ||
+ | </syntaxhighlight> | ||
+ | Checking the Status | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | # df -h | grep nfs | ||
+ | YourIPAddress:/export/nfs 7.3G 3.5M 6.8G 1% /mnt/nfs | ||
+ | </syntaxhighlight> | ||
+ | To set up automatic mounting at boot time, add the following line to the /etc/fstab file: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | YourIPAddress:/export/nfs /mnt/nfs nfs defaults 0 0 | ||
+ | </syntaxhighlight> | ||
+ | ==Transferring Docker Data to a Hard Drive== | ||
+ | Access "Storage" -> "Shared Folders," and click the "+" icon to create three folders, namely: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | docker -> The Docker data directory, defined in /etc/docker/daemon.json | ||
+ | docker-compose -> Location of compose files | ||
+ | docker-data -> Location of persistent container data | ||
+ | docker-app -> For personal use, storing Dockerfiles and data | ||
+ | </syntaxhighlight> | ||
+ | Access "Services" -> "Compose" enter the "Settings" interface, and configure the "Shared folder" for "Compose Files" and "Data",<br /> | ||
+ | <br /> | ||
+ | Access the SSH terminal and execute the following command to move Docker data to the shared folder, where "/srv/dev-disk-by-uuid-XXYYZZ/docker" represents the absolute path of the shared folder, which can be obtained from the "Storage" -> "Shared Folders" list on the web interface: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | su root | ||
+ | systemctl stop docker.socket docker.service | ||
+ | mv /var/lib/docker/* /srv/dev-disk-by-uuid-XXYYZZ/docker/ | ||
+ | </syntaxhighlight> | ||
+ | On the web interface, set the "Docker storage" to the absolute path of the "docker" shared folder. save the settings and apply, and then reboot the system. | ||
+ | ==Install Nextcloud with Docker== | ||
+ | Run the following command in the terminal: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | su root | ||
+ | cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) | ||
+ | mkdir nextcloud | ||
+ | cd nextcloud | ||
+ | mkdir data | ||
+ | |||
+ | docker run -d -p 8888:80 --name nextcloud \ | ||
+ | -v $PWD/data:/var/www/html --restart=always \ | ||
+ | --privileged=true arm64v8/nextcloud | ||
+ | </syntaxhighlight> | ||
+ | you can access the Nextcloud web interface by opening a web browser and navigating to http://YourIPAddress:8888/ (replace YourIPAddress with the actual IP address of your device). | ||
+ | ==Install Filebrowser with Docker== | ||
+ | Run the following command in the terminal: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | su root | ||
+ | cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) | ||
+ | mkdir filebrowser | ||
+ | cd filebrowser | ||
+ | |||
+ | docker run -d -v $(readlink -f /srv/dev-disk-by-uuid-*):/srv \ | ||
+ | -v $PWD/filebrowserconfig.json:/etc/config.json \ | ||
+ | -v $PWD/database.db:/etc/database.db -p 8080:80 \ | ||
+ | --restart=always --name filebrowser \ | ||
+ | filebrowser/filebrowser | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | After completing the setup, you can access the Filebrowser web interface by opening a web browser and navigating to http://YourIPAddress:8080/ (replace YourIPAddress with the actual IP address of your device). The default username and password for Filebrowser are both "admin". | ||
+ | ==Install Jellyfin with Docker== | ||
+ | Access "Storage" -> "Shared Folders," click the "+" icon to create a "media" folder for storing multimedia resources. Then, in the command-line terminal, you can run the following command to install Jellyfin: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | su root | ||
+ | cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) | ||
+ | mkdir jellyfin | ||
+ | cd jellyfin | ||
+ | mkdir config cache | ||
+ | |||
+ | docker run -d --name jellyfin \ | ||
+ | -v $PWD/config:/config \ | ||
+ | -v $PWD/cache:/cache \ | ||
+ | -v $(readlink -f /srv/dev-disk-by-uuid-*/media):/media \ | ||
+ | -p 8096:8096 \ | ||
+ | --restart=always \ | ||
+ | jellyfin/jellyfin | ||
+ | </syntaxhighlight> | ||
+ | After completing the setup, you can access the Jellyfin web interface by opening a web browser and navigating to http://YourIPAddress:8096/ (replace YourIPAddress with the actual IP address of your device). This will allow you to access and manage your media content using Jellyfin. | ||
+ | ==Install Portainer with Docker== | ||
+ | Run the following command in the terminal: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | su root | ||
+ | cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) | ||
+ | mkdir portainer | ||
+ | cd portainer | ||
+ | mkdir data | ||
+ | |||
+ | docker run -d \ | ||
+ | --name portainer \ | ||
+ | --restart=always \ | ||
+ | -e TZ=Asia/Shanghai \ | ||
+ | -p 8000:8000 \ | ||
+ | -p 9000:9000 \ | ||
+ | -v /var/run/docker.sock:/var/run/docker.sock \ | ||
+ | -v $PWD/data:/data \ | ||
+ | portainer/portainer-ce:latest | ||
+ | </syntaxhighlight> | ||
+ | After completing the setup, you can access the Portainer web interface by opening a web browser and navigating to http://YourIPAddress:9000/ (replace YourIPAddress with the actual IP address of your device). The default administrator account username and password are both "admin". |
Revision as of 10:52, 26 September 2023
Contents
- 1 OpenMediaVault version
- 2 Supported platforms
- 3 Find IP Address
- 4 Access the OpenMediaVault web page
- 5 Change the web login password
- 6 Configure the web page timeout duration
- 7 Logging in via SSH
- 8 Create the root user
- 9 Configure the hard drive and shared folders
- 10 Create NAS users
- 11 Create a Samba share
- 12 Create an NFS share
- 13 Transferring Docker Data to a Hard Drive
- 14 Install Nextcloud with Docker
- 15 Install Filebrowser with Docker
- 16 Install Jellyfin with Docker
- 17 Install Portainer with Docker
1 OpenMediaVault version
- OS: Debian 11
- OpenMediaVault: 6.9.0-1 (Shaitan)
- Docker: 24.0.6
- Others: built-in OMV-Extras and openmediavault-compose
2 Supported platforms
- RK3328
- RK3399
- RK3568
- RK3588
3 Find IP Address
Since the hostname is set by default to the model of the development board, you can use the "ping" command to obtain the IP address. For example, for NanoPi-R2C, you can use the following command:
ping NanoPi-R2C
4 Access the OpenMediaVault web page
Enter the IP address of the development board in your web browser; the default login account for the web interface is:
Username: admin Password: openmediavault
5 Change the web login password
Click on the profile picture in the upper-right corner of the web page, then select "Change Password"
6 Configure the web page timeout duration
Navigate to "System" -> "Workbench" and adjust the "Auto Logout" time setting.
7 Logging in via SSH
ssh pi@YourIPAddress
The default password is "pi".
8 Create the root user
Create the root user and add user to the root and ssh groups:
sudo passwd root sudo gpasswd -a root root sudo gpasswd -a root ssh
You can now use the root user to log in via SSH:
ssh root@IPAddress
(Note: If the hard drive has already been initialized and RAID has been preserved, you can proceed directly to step four for mounting.)
9.1 Step One: Initialize the storage device (Optional)
Navigate to "Storage" -> "Disks," select your storage device, and click the "Wipe" icon to perform disk erasure (please ensure your data is backed up). Typically, you can choose "Quick" erase.
9.2 Step Two: Create RAID (Optional)
(Note: USB interface hard drives are not supported, and OpenMediaVault will not list USB storage devices on the RAID creation page.)
Go to "Storage" -> "Software RAID" click the "+" icon, choose the RAID level, and apply the settings.
9.3 Step Three: Create File System (Optional)
Go to "Storage" -> "File Systems," click on the "+" icon, and for the type, it's recommended to choose "BTRFS." Select "Single" and check the storage device. If you created a RAID in the previous step, choose a device starting with /dev/md. If it's a USB hard drive, choose /dev/sda.
9.4 Step Four: Mount the File System
Go to "Storage" -> "File Systems," click the ">" icon for mounting existing file systems, and choose the device you want to mount.
Go to "Storage" -> "Shared Folders," click the "+" icon to create two folders named "nfs" and "samba." We will use these folders for testing NFS and Samba sharing in the following steps.
(Note: If there were previously created shared folders on the hard drive, you can recreate them with the same names, and the data will be preserved.)
10 Create NAS users
Debian system users or Linux users created via the command line may lack certain permissions required for services like Samba and NFS. Therefore, it is recommended to use the OpenMediaVault interface to create a user specifically for accessing Samba and NFS shares. Here, I will create a user and group named "nasuser":
Click on "Users" -> "Groups" and then click the "+" icon to create a user group named "nasuser".
Click on "Users" -> "Users" then click the "+" icon to create a user named "nasuser", change user's shell to "/usr/sbin/nologin", and select the "nasuser" and "users" groups.
Go to "Services" -> "SMB/CIFS" -> "Settings," check the box at the top for "Enabled," select "SMB1" as the minimum protocol version, and then click "Save"
Go to "Services" -> "SMB/CIFS" -> "Shares," click the "+" button, and in the "Shared folder" field, select the folder you want to share. as an example, here i select the "samba" folder
Testing:
On Mac system, right-click Finder, select "Connect to Server," and enter "smb://YourIPAddress" (replace with the actual IP address). A authentication dialog will appear; enter the username "nasuser" and the password to access the share.
Go to "Services" -> "NFS" -> "Settings" check the box at the top for "Enabled", and in the "Versions" section, select all versions, including "NFSv2", then click "Save" and apply the settings.
Go to "Services" -> "NFS" -> "Shares," click the "+" button, and in the "Shared folder" field, select the folder you want to share. here i select the "nfs" folder. In the "Client" section, enter the IP range or specific IPs that are allowed to access the share (e.g., 192.168.1.0/24). Set the permissions to "Read/Write", in the "Extra Options" field, Input:
rw,async,insecure,no_subtree_check,all_squash,anonuid=0,anongid=0
Then click "Save" and apply the settings.
12.1 Testing NFS mounting on a Mac
Viewing OpenMediaVault's NFS Share Information via Command Line
# showmount -e YourIPAddress Exports list on YourIPAddress: /export 192.168.1.0/24 /export/nfs 192.168.1.0/24
Right-click Finder on your Mac, select "Connect to Server," and in the address bar, input:
nfs://YourIPAddress/export/nfs
12.2 Testing NFS mounting on Linux
Installing the NFS client
sudo apt install nfs-common
Start to mount:
sudo mount -t nfs YourIPAddress:/export/nfs /mnt/nfs
Checking the Status
# df -h | grep nfs YourIPAddress:/export/nfs 7.3G 3.5M 6.8G 1% /mnt/nfs
To set up automatic mounting at boot time, add the following line to the /etc/fstab file:
YourIPAddress:/export/nfs /mnt/nfs nfs defaults 0 0
13 Transferring Docker Data to a Hard Drive
Access "Storage" -> "Shared Folders," and click the "+" icon to create three folders, namely:
docker -> The Docker data directory, defined in /etc/docker/daemon.json docker-compose -> Location of compose files docker-data -> Location of persistent container data docker-app -> For personal use, storing Dockerfiles and data
Access "Services" -> "Compose" enter the "Settings" interface, and configure the "Shared folder" for "Compose Files" and "Data",
Access the SSH terminal and execute the following command to move Docker data to the shared folder, where "/srv/dev-disk-by-uuid-XXYYZZ/docker" represents the absolute path of the shared folder, which can be obtained from the "Storage" -> "Shared Folders" list on the web interface:
su root systemctl stop docker.socket docker.service mv /var/lib/docker/* /srv/dev-disk-by-uuid-XXYYZZ/docker/
On the web interface, set the "Docker storage" to the absolute path of the "docker" shared folder. save the settings and apply, and then reboot the system.
14 Install Nextcloud with Docker
Run the following command in the terminal:
su root cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) mkdir nextcloud cd nextcloud mkdir data docker run -d -p 8888:80 --name nextcloud \ -v $PWD/data:/var/www/html --restart=always \ --privileged=true arm64v8/nextcloud
you can access the Nextcloud web interface by opening a web browser and navigating to http://YourIPAddress:8888/ (replace YourIPAddress with the actual IP address of your device).
15 Install Filebrowser with Docker
Run the following command in the terminal:
su root cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) mkdir filebrowser cd filebrowser docker run -d -v $(readlink -f /srv/dev-disk-by-uuid-*):/srv \ -v $PWD/filebrowserconfig.json:/etc/config.json \ -v $PWD/database.db:/etc/database.db -p 8080:80 \ --restart=always --name filebrowser \ filebrowser/filebrowser
After completing the setup, you can access the Filebrowser web interface by opening a web browser and navigating to http://YourIPAddress:8080/ (replace YourIPAddress with the actual IP address of your device). The default username and password for Filebrowser are both "admin".
16 Install Jellyfin with Docker
Access "Storage" -> "Shared Folders," click the "+" icon to create a "media" folder for storing multimedia resources. Then, in the command-line terminal, you can run the following command to install Jellyfin:
su root cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) mkdir jellyfin cd jellyfin mkdir config cache docker run -d --name jellyfin \ -v $PWD/config:/config \ -v $PWD/cache:/cache \ -v $(readlink -f /srv/dev-disk-by-uuid-*/media):/media \ -p 8096:8096 \ --restart=always \ jellyfin/jellyfin
After completing the setup, you can access the Jellyfin web interface by opening a web browser and navigating to http://YourIPAddress:8096/ (replace YourIPAddress with the actual IP address of your device). This will allow you to access and manage your media content using Jellyfin.
17 Install Portainer with Docker
Run the following command in the terminal:
su root cd $(readlink -f /srv/dev-disk-by-uuid-*/docker-app) mkdir portainer cd portainer mkdir data docker run -d \ --name portainer \ --restart=always \ -e TZ=Asia/Shanghai \ -p 8000:8000 \ -p 9000:9000 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $PWD/data:/data \ portainer/portainer-ce:latest
After completing the setup, you can access the Portainer web interface by opening a web browser and navigating to http://YourIPAddress:9000/ (replace YourIPAddress with the actual IP address of your device). The default administrator account username and password are both "admin".