Question

How would I properly set up local and production development for WordPress project?

Hi DO community!

I have a question or a guideline on the WordPress project.

I’ve been tasked to do WordPress project for the company but I don’t know how to separate local development from production. Obviously I don’t want to code in the live website. I want to code locally and then with all of the approval deploy the changes to production.

I’ve already created an instance with the following specs: Ubuntu 18.04 LTS NGINX PHP MySQL SSL certificate has been installed by the Let’s Encrypt

In this case, workflow differs when you develop local vs production.

I’ve read the using Git or Docker might help but I am not sure how to do that right.

Thanks in advance

Subscribe
Share

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

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.

Hi @admax88,

I’ll recommend using Git as well. Git will allow you to push your files online and then you can download them/clone them once ready on your droplet. If you are uncertain at how to use git, it’s real easy, it won’t take you more than an hour or two to get used to it. Here is an article which will help you out :

https://www.digitalocean.com/community/cheatsheets/how-to-use-git-a-reference-guide

Alternatively, you can use FTP and upload your code once you are finished with developing the website but that’s a lot slower process than using git.

Regards, KFSys

Hi @KFSys,

I am thankful for your reply.

This is another confirmation that Git is the right tool for it.

Do I need to use environment variable to set one variable for development and another for production?

I came across this article explaining how to use environment variables.

https://www.twilio.com/blog/working-with-environment-variables-in-node-js-html

Thanks, admax