Domain name change

I have a Nextcloud box from HanssonIT with my own domain. Now I want to change the domainname to a new one. What are the necessary steps?

  • Change ‘trusted_domains’ and ‘overwrite.cli.url’ settings in config.php?
  • Necessary to change ‘hostname’ and ‘hosts’?
  • Changes needed iin apache2.conf?
  • How do I create a new Letsencrypt certificate for the new domain?
  • Other steps?


They added something in the documentation that it is currently not supported due to missing client support ([stable24] add domain change documentation by backportbot-nextcloud · Pull Request #8196 · nextcloud/documentation · GitHub). However, I managed to do this in the past with just changing a subfolder and using permanent redirects (perhaps not all clients support it, especially some apps might have dedicated apps).

The hostname is not really required. For the webserver (apache), you can use a new virtual host with the new domain name. And then you can use the letsencrypt bot to issue a certificate for the new domain as well. You can even create certificates with two domains, however if you want to use the other domain for a different purpose, I’d keep them separated.

Thx for your help. My Nextcloud server is from HanssonIT. They pre-installed it with a menu to install/configure additional software/settings. I discovered that there was also an option to add/change the domain. So that did the trick.