Changing domain name associated with the server

July 14, 2018 1.1k views
LAMP Stack Let's Encrypt Ubuntu 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!

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.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!