NFS Share + RustFS Docker Deployment
In this tutorial we will explain how you setup your own RustsFS S3 Storage. This will allow you to use S3 storage for self hosted applications that allow or require it. It is yet another way of storing photos and videos but instead of using an NFS share or local storage. Now, ideally you setup a dedicated box with hard drives to run your RustFS instance. However, in a HomeLab that is not always feasible nor necessary. The beauty of RustFS is that it just needs a folder to store all the objects in. Therefor, if you already have an NAS or NAS VM you could create an NFS share and attach it to that folder. This is what we will do in this tutorial
Setup the NFS Share
1. The first thing we need to do on your TrueNas instance is create a new user: 1001 and group 1001. The reason for this is because RustFS runs on this user and group and hence the objects folder /mnt/rustfs needs to be owned by that user and group. For instructions check out our TrueNas Book
2. Then create a new dataset and attach the user 1001 and group 1001 to it
3. Then setup the NFS share on your TrueNas instance.
4. Sweet, now you setup on TrueNas is set and done. Now, you will enter either your DockerVM or a new dedicated VM to run your RustFS instance on. Regardless we first make a new folder
mkdir rustfs
5. We then make the data directory that will store all the objects with. You can choose any location and name but for this example we will use
mkdir /mnt/rustfs
6. Next make sure that an NFS-Client is installed and if not it is easy to install with
sudo apt install nfs-common
7. Perfect, now attach the NFS share to the /mnt/rustfs folder by adding a new entry in the /etc/fstab section
sudo nano /etc/fstab
8. Then add the following line
IP-Address-TrueNasVM:/mnt/tank/rustfs /mnt/rustfs nfs defaults 0 0
9. Alrightieee!!! NFS and Storage folder is all setup, then now we can move to the Docker compose file
Docker Compose File
dpasn@sandbox:~$ sudo chown dpasn:dpasn -R /mnt
dpasn@sandbox:~$ sudo chmod 775 -R /mnt
dpasn@sandbox:~$ mkdir /mnt/rustfs
Make sure NFS Client is installed with