NFS Server in Proxmox CT, LXC, Container

I am going to start this guide off at the point of having made an unprivileged container. For this guide we are using a ubuntu 22.04 image.

Select your Proxmox server in the datacenter menu and open the Shell

Take note of your CTs id number

go to Shell

Enter the command

nano /etc/pve/lxc/<CT #>.conf

Add the below line at the bottom

lxc.apparmor.profile: unconfined 

Now go back to the Web Interface START the CT and open the console

apt update && apt upgrade -y

Use the command

apt install nfs-kernel-server -y 

To install the NFS server

After installing NFS server lets add a folder to store the shared data in

mkdir -p /srv/nfs4/backup

We now need to edit the exports file to tell the server what folder and how to share the folder

nano /etc/exports


exportfs -ar

to modify the exports file

Now it is time to start using your new NFS server

if you find that you have problems writing to the folder you might need to run

chmod 777 <file path>

This will loosen up the user write restrictions and allow everyone to write files to this folder.


Regain Access to Proxmox after Bad Firewall Rule

You can lose access to a server fast when working with firewalls but they are need. So here is what you do if you have made a BAD rule for your firewall and can no longer access your Proxmox server with the web interface.

Plug in a monitor and keyboard in to the server


Enter the command

pve-firewall stop

Installing NextCloud in Proxmox Container, CT, LXC

If you are going to run snap in a Proxmox container the first thing that you are going to need to have is a container if you already know how to make a container you can skip to the point where we are installing software.

The first step in setting up a container is to get the image that we will use for the container. to do that open the dropdown for your server labeled here as R2D2. Then go down to local and select it, then select CT Templates, after selecting CT Templates, select Templates.

With CT Templates open select the image that you plan on using for this guide I will be using Ubuntu 22.04, after selecting the image click download.

After your image is downloaded it will show up in the CT Templates folder of the local drive.

Enter the hostname for you CT or container, then fill out your root password, finish by clicking Next.

At this screen select the Template that you downloaded.

select the drive that you will store the CT on and set the max size for the CT.

Set the number of CPU cores.

Set the amount of RAM to use for your CT.

Enter the IP address fallowed by the CID sub net mass for most home networks smaller then 254 systems this most likely will be /24. Then enter the address to the gateway on most home networks this will be the ip address for your router.

If your Proxmox server was setup right when installing your should not have to fill out this page, so click Next

If all looks good click Finish.

When the CT is fully setup it will say TASK OK close the window.

Select your new CT under the drop down for your server, then select Options and under Options select Features and click Edit.

A window like this will appear and select FUSE and click OK

To start your CT click Start, then Console to display a command promote.

To log in enter a username of root and the password that was entered in the CT setup.

To update the CT enter the command

apt update && apt upgrade -y

Now with the CT up to date it is time to install the software that we will use to install snap packages to do this use the command

apt install squashfuse snapd -y

Now it is time to install your snap package. to do this you are going to use the command below. This might fail the first time.

snap install nextcloud

This is what it will look like if it fails. The problem is due to apparmor.

Rerun the command and it will complete.

After we use snap to download nextcloud we need to run some command to setup and finish installing nextcloud

nextcloud.manual-install <username> <password>

The last thing that we need to do before we login and start using NextCloud is tell NextCloud that we can trust the ip address

nextcloud.occ config:system:set trusted_domains 1 --value=<ip address>

Now we can open a web browser and enter the server ip address in the url bar