Changing domain name associated with the server

Posted July 14, 2018 3.2k views
LAMP StackLet's EncryptUbuntu 16.04


I have a working LAMP server that I used to set up a new website.
The server has a temporary domain pointing to it (e.g. and I’m using Let’s Encrypt to provide SSL.

Now that everything is set up and working, I’m ready to point the actual domain (e.g. to that server.

To do that I will change the DNS records with the registrar to point to DO and set up the appropriate settings under Networking->Domains.

How do I go about changing the SSL on the LAMP instance itself? Can I just run: certbot –apache -d -d and it will take care of it all, or will there be problems because a different domain was set up previously?

I’m hesitant to just test this out because I want to have minimal downtime during the switch so I figured I’d ask the community.

Thanks in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello friend!

Running certbot for the new domain will likely take care of it fine. I’m assuming you haven’t explicitly defined the temporary domain in the servername/serveralias variables but instead have a default virtual host with a specific SSL being the only clear reference to the domain. It could take more if I am assuming wrong, but through the process of mentioning that possibility it should remind you of any configurations you’ve already made.

Kind Regards,

  • Thanks for your answer Jarland.

    Just to be safe I played back the scenario using two spare domain names and test server and it worked just as you expected.