So let's install the appropriate packages.
sudo apt install nfs-kernel-server is what it's called on Ubuntu.
And if you also want the client, I advise to install nfs-common as well.
So yeah, we want to install that.
And then sudo vim-etc-exports.
And let's just export the slash var directory.
To what? Well, to star rw no root squash.
We don't have to go very deep into NFS options.
So the wide open share will do well enough.
So do we have UFW open?
Let's check using sudo ufw status.
And there we can see that UFW is currently inactive.
Well, that makes it easier.
I like to start using show mount minus e localhost.
Before I go remotely, I want to show if mounts are available locally.
And no, no, I don't see anything. Does that make sense? Of course it does.
Sudo systemctl start nfs-utils.service.
And then show mount minus e localhost is still not showing it.
Hmm, that is curious.
What I'm looking for is not nfs-utils.service.
It's nfs-server.service.
So where is it?
Let me use systemctl list unit files pipe-grep nfs.
That's the best solution.
And there I can see that, oh, nfs-server.service is already enabled.
And you know what?
This is a curiosity in systemd.
If you use sudo systemctl start
and then you use tab completion on a server that is already started,
it won't show.
So I'm just going to use sudo systemctl restart nfs-server.
The thing on Ubuntu is that you install a service.
Then it will automatically be started.
So if after installation you create the configuration,
you need to restart it.
And now the show mount minus e on local h.
No, let's make that localhost.
As you can see, that is working now.
And feel free to access it from the client as well.