TrueNAS Scale: Ultimate Home Setup incl. Tailscale

After a reboot the nfs share wont mount. The mount -a command gives me an error, “Operation not permitted”. I have added the share to the fstab. I can mount the share when i am sudo but I would like to fix this workaround. Thank you.

Edit: I have gotten the mount to persist after a reboot but now docker wont install any files in the directory. I can touch to the mounted directory and I see it in the TrueNAS shell. The container will be stuck restarting whenever I try to run the docker command to install portainer. Nothing will show up in the portainer_data folder as well.

I’ve tried to create debian VM on truenas scale using UEFI settings. I’ve added boot option and it was working until i rebooted Truenas host. After that bot option was missing again.
Is there a way to setup debian VM that will survive restart and will boot normally or do i have to go with legacy boot?

EDIT: was able to solve it doing expert install and forcing grub installation when asked, and its working on UEFI boot :slight_smile:

Thank you so much for this guide! But An issue I was having is even after doing the network fix that you talked about I still had to set the default gateway and add 2 name servers 1.1.1.1 and 1.0.0.1
Did I miss something about this? Is it rare that I have to do these steps? Both my installs of TrueNas Scale required this.
Thanks for any insight on this issue.

Good catch. the guide is getting a little old and I need to revisit.

Be careful goo as when you update you’ll get a warning that truenas needs to install their apps. This will clobber your normal docker install so don’t do it. Or just be aware of it.

1 Like

Sorry can you elaborate? Are you talking about the recent TrueNas Scale update that broke a bunch of things with TrueCharts? If you are, from what I read this effects you more if you are not using hostpaths right?
I don’t have much installed right now on my server. Ubuntu VM for plex then the official charts of homebridge and nextcloud. The only TrueCharts I have is kavita and I think/hope it’s gonna be ok but I haven’t done that update yet.

Hey, I just want to mention, on the post for the guide I created after this one, multiple people have posted that they were able to update with nothing breaking and no need for any action on their part.

@tetsujinxliv
If you wish, you can look at that guide here:

2 Likes

If you are planning on doing an updated guide can you please make it a walkthrough. I would love a video showing the full process and command line. I would like to see you be through since there is a lot of small thing that you miss out on through audio that would help someone inexperienced tremendously. If you could, please also list out common errors and ways to fix them. Thank you

Edit: I would also appreciate if you could include how to add a domain for all of the services. A domain thats local but also has https certificates. I appreciate your time and consideration. Thanks again Wendell.

Edit 2: Sorry to keep adding to the list, but if you could also show how to set up a dockerized mariadb/mysql database for all of the services and containers. Also how to manage the database and best practices for security. Thank you.

6 Likes

I deleted the above post. I figured out my problem with getting nextcloud installed. The dockerhub nextcloud official image has a compose file with an extra command and newer db version that worked for me.

If any of you are able to get to the install web interface but it refuses to connect to the db, try the dockerhub compose file! It is nearly identical, you will need to change the volume locations to match the one given here.

Do you think headscale is there yet in terms of a open source hostable tailscale auth server?

Or is it simply too painful rn?

Too painful rn and I really don’t mind how tailscale works now that I understand it. It’s not unreasonable

1 Like

Thanks for letting me know. Whats the device limit for the free version? Any draw backs to it?

Im wondering if that’s too much of a limitation. Im totally okay with just naming users and giving them certain levels of ACLs i.e Guest, Friends, Family

1 Like

3 users, up to 100 devices. routed devices don’t count so if you tailsale your router and allow subnet access you can end up with access to many more than 100 devices.

100 devices is kind of a lot imho

1 Like

Yeah its way over the count I have. I wonder if mikrotik supports it. Man this would make remote management of family networks spread across two states way easier

I am pretty sure they do.

1 Like

Sweeet this is going to work out well

Just added a link to my previous post. Mikrotik has native docker support on the routerOS so you can run a Tailscale gateway in docker.

I’m having troubles with permissions, when deploying nextcloud:

failed to deploy a stack: Network nextcloud_default Creating Network nextcloud_default Created Container nextcloud-db-1 Creating Container nextcloud-db-1 Created Container nextcloud-app-1 Creating Container nextcloud-app-1 Created Container nextcloud-db-1 Starting Container nextcloud-db-1 Started Container nextcloud-app-1 Starting Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: chdir to cwd (“/var/www/html”) set in config.json failed: permission denied: unknown

Im using the latest truenas scale if that makes a difference and debian 12.
nextcloud/data + nextcloud/database are getting created with these owners and groups. I’m really struggling to get it working at this point.
drwxrwx— 2 root root 2 Jul 10 23:07 data
drwxrwx— 5 999 systemd-journal 13 Jul 10 22:35 database

I’m having the same problem. A previous answer in this thread stated that adding “no_root_squash” to the fstab mount command and the rebooting the vm might fix it but when I try it the share doesn’t mount at /nfs. If you have any luck please update the thread.

Okay, here is what you do:

In the TrueNAS interface click on SystemSettings > Shell

edit /etc/exports
sudo nano /etc/exports

there you will see a line which shares the NFSDocker dataset. Within the parenthesis you will see a comma separated list of options
IE (sec=sys,rw,anonuid=1001,anongid=1001,no_subtree_check)

at the end of this list Inside the parenthesis add a comma and no_root_squash to the list

(sec=sys,rw,anonuid=1001,anongid=1001,no_subtree_check,no_root_squash)

save and exit the file then run the command sudo exportfs -ra

Now if you reboot the virtual machine which is running docker you should then be able to create the nextcloud instance in portainer.

hope this helps!

1 Like

Ah, nice glad you’ve worked it out. I did a bit of googling about no_root_squash, from the looks of it, it doesn’t seem like the best idea. Why we should not use the no_root_squash Option | Server Buddies so I went on a big tangent which is only really worked recently.

I managed to somewhat solve the issue I was having by creating a dummy file in each folder I created for the nfs share. That way docker avoids an initialization step. I don’t have access to my desktop but I found a good post about it on stackocerflow. I also gave up and then just used the truecharts version.

In general my work flow is:

  1. Create a volume in portainer point to the nfs share ( you end up with more volumes this way but its the only way that’s worked for me without no root squash
  2. Create a file jn the mounted directory using touch test then run chown nfsdocker test and chgrp nfsdocker test
  3. In the stacks use a similar template to this
    Example with code server:
version: "2.1"
services:
  code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    environment:
      - PUID=1001
      - PGID=3002
      - TZ=Etc/UTC
      - PASSWORD=password #optional
      - HASHED_PASSWORD= #optional
      - SUDO_PASSWORD= #optional
      - SUDO_PASSWORD_HASH= #optional
      - DEFAULT_WORKSPACE=/config/workspace #optional
    volumes:
      - code_server:/config
    ports:
      - 8443:8443
    restart: unless-stopped
volumes: 
  code_server:
    external: true

This setup has worked for me on a few containers such as: code server, nginx proxy manager, node. However not nextcloud lol. It worked with the db aspect but it wasn’t having it for nc.

I don’t know if you tried tailscale or not, but it’s very picky with what it can find on my network. Running as a subnet router it struggles to find certain ports on my machine, not sure why. Specifically jellyfin running in truecharts.

I want to be able to host nextcloud on the Internet so I’m using nginx proxy manager, which I’ve managed to get to work ish. If anyone is interested in that setup let me know. I used cloudflareddns, nginx proxy manager to get it working. Steps are:

  1. Get domain.
  2. Change namesevers for domain to cloudflares
  3. Generate an api key for dns (I used cloudflares default of edit dns, I think it’s needed to prove you own the domain it’ll use certbot within nginx to check some dns records.
  4. Use the key in nginx proxy manager, go to ssl set the domain to yours matching your A record. Or use a wildcard *.yourdomain.com then set dns via cloudflare and put in your api key.

Ddns:

  1. Generate api key with permissions I followed this for the right permissons: How to Setup Cloudflare Dynamic DNS
  2. Use a stack with the following;
version: '2'
services:
  cloudflare-ddns:
    image: oznu/cloudflare-ddns:latest
    restart: always
    environment:
      - ZONE=YOURDOMAIN
      - PROXIED=true
      -API_KEY=YOURKEY

And that’s all you should need to do.