NFS Share + RustFS Docker Deployment
In this tutorial we will explain how you setup your own RustFSRustsFS S3 Storage. IfThis will allow you haveto 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 resourcesobjects forin. 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 server.TrueNas Otherwiseinstance 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 cansetup alsoon justTrueNas hostis itset asand done. Now, you will enter either your DockerVM or a containernew insidededicated VM to run your existing VM. Now, RustFS wantsinstance thaton. youRegardless providewe itfirst make a new folder
mkdir whichrustfs
5. We then make the data directory that will store all ofthe yourobjects objects.with. ThereforeYou makecan achoose folderany e.glocation 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