I think it's worth your time to investigate docker containers. Look into the all-in-one nextcloud container (AIO). Last I heard, that's the recommended way to do it.
nextcloud
Nextcloud is a suite of client-server software for creating and using file hosting services.
IRC: #nextcloud on libera.chat
Matrix: #nextcloud:matrix.org
Other Nextcloud communities on Lemmy
If you're gonna go docker definitely do the AIO. As huquad mentioned its the official docker deployment method, and its the best docker implementation I've used for Nextcloud, and I tried em all.
In short: Yes, every computer van become a server. It is a matter of installing the right software :-)
The software you know is made to interact with using your screen, but there is a lot of software that is not using your screen at all but is going to interact over your network, like Nextcloud Server :-)
You could just follow the installation instructions for Nextcloud Server on your laptop.
A server is a computer that provides a network service to other computers. While professional servers are purpose-built and provide additional reliability and management features, any computer may act as a server. Laptops work especially well as makeshift servers because they typically include built-in battery power.
With Ubuntu on that laptop, look into the snap package for nextcloud server. Everything I've heard about it is that its a great and pretty easy was to get a nextcloud server up and running.