Creating a DNS entry is optional, but when the NextCloud first run wizard happens in the browser, it sets the config.php to trust the URL in the browser. If you do not have DNS setup yet, you will have to go back and add this to yout config.php later anyway.

#create a DNS entry for your server and go to it in your browser to complete the setup
http://nextcloud.domain.com/nextcloud

On the web GUI, enter your desired admin username and password.

Then click the Storage & database dropdown.

Leave the data folder alone unless you know that you changed it when going through the above instructions.

Change the database to MySQL/MariaDB

Then fill it out with the information you used above.

Click the Finish setup button

You will be automatically logged in and greeted with this.

Go back to your SSH session and update the NextCloud config.php file to tell it to use redis for the memory cache and file locking.

Now you have a nice working basic install, but the URL (http://nextcloud.domain.com/nextcloud) is nasty.
Who always wants to see /nextcloud in the URL all the time?
Also once signed in, you will always see /index.php/ in the URL.
This is simple to resolve.

First update the webserver config and config.php to not use the /nextcloud folder

#remove need to use /nextcloud in URL by changing the document root in apache. This also adds the benefit of giving you a valid page if someone goes to the raw IP.
nano /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html" to DocumentRoot "/var/www/html/nextcloud"
#update nextcloud config.php to remove /nextcloud
nano /var/www/html/nextcloud/config/config.php
'overwrite.cli.url' => 'http://nextcloud.domain.com',

Now update the config.php and have it update the .htaccess file to hide the index.php from the URL.

# add this line to the nextcloud config.php to remove the index.php in all the URLS
'htaccess.RewriteBase' => '/',
#then run this to apply it to the .htaccess file
cd /var/www/html/nextcloud && sudo -u apache php occ maintenance:update:htaccess
#restart apache
systemctl restart httpd

Now you can go to your URL without the /nextcloud and links will not have the /index.php/ in them.

#now go to your URL without the /nextcloud
http://nextcloud.domain.com

#run certbot to get your SSL certificate, you will a warning that it could not update a vhost file. That is because there is not one named to match the domain. That is beyond the scope of this guide.
certbot --apache certonly --email [email protected] --domain nexcloud.domain.com --agree-tos --non-interactive

If you are running your Nexcloud instance behind a reverse proxy that handles the SSL, then your links may all be going out as http instead of https.

This is because Nextcloud tries to figure this out on its own and it only sees the http connection hitting it. You can override this default behavior by updating the Nextcloud config.php to contain the following line.

@JaredBusch I am thinking about scripting it out, unless you already have started on it?

Going to Ansible or something like that is like a scripted install, but more automated and, if created idempotently, can be used to enforce consistency down the road. If you were to take the time to script the install here, it's worth considering moving to that approach. No need for an infrastructure to do that, you can just store an Ansible playbook on GIT or similar (there is free hosting out there for that) then just pull it from there.