Introduction
Nextcloud is a versatile and powerful open-source platform that allows you to set up your own cloud server for file storage, collaboration, and more. To make your Nextcloud installation more accessible and user-friendly, you can assign a custom domain name to it. This not only provides a professional touch but also simplifies access for you and your users. In this guide, we will walk you through the process of giving your Nextcloud instance a custom domain name.
Prerequisites
Before you start, make sure you have the following prerequisites in place:
- Nextcloud Installed: You should already have Nextcloud up and running on your server.
- A Registered Domain: You need a domain name that you’ve registered through a domain registrar. This domain will be used to access your Nextcloud instance.
Step 1: Obtain a Static IP Address for Your Server
Begin by opening a terminal window on your Ubuntu Server. The terminal is your gateway to the command line, where you can interact with your server’s operating system.
Once your terminal is up and running, simply type the following command and press ‘Enter’:
ifconfig
Step 2: Configure DNS Settings
- Log in to your domain registrar’s control panel.
- Locate the DNS settings or Domain Management section.
- Create a new DNS record (often referred to as an “A Record”) with the following details:
- Type: A
- Host or Name: Enter ‘@’ to represent your root domain.
- IP Address: Enter your server’s static IP address.
- Create a CNAME record to point the ‘www’ subdomain to your domain. The details for the CNAME record are:
- Type: CNAME
- Host or Name: Enter ‘www’
- Value: Enter your domain name.
- Save your DNS settings.
Example) AWS Route 53
Even if you complete adding records, you will encounter this message. In order to access your nextcloud, you also need to add the domain in the configuration file.
Run the following command to set a trusted domain for Nextcloud, replacing yourDomainName
with your actual custom domain:
sudo nextcloud.occ config:system:set trusted_domains 1 --value=yourDomainName
sudo nextcloud.occ config:system:set trusted_domains 2 --value=yourDomainName2
By executing these commands, you will have two trusted domains configured for your Nextcloud instance, allowing access from both yourDomainName1
(A record) and yourDomainName2
(CNAME record).