How do You Set Up a Local Install of Wordpress on Zorin OS?

Hello everyone,

I am looking into Wordpress theme development, so I wanted to create a local install on my machine to test things out, however I can't get it to work and I could really use some help.

I used the guide from the Wordpress docs to set up wp-env through node.js. It requires docker to work, which is where I am running into some issues. The guide suggests using the docker desktop app, however I do not want to use proprietary software, so I am using docker through the command line. From my internet research, wp-env should work with or without the docker desktop app.

First I installed docker with no issues using:

sudo apt install docker.io

Then I launched it as a system service, so it was running in the background using:

sudo systemctl start docker

Looking at its status with sudo systemctl status docker it says it is active (running).

Then I created a new project with npm init for the package.json file, and then I installed wp-env as a dev dependency.

I tried to launch it using npx wp-env start and I got this error:

Could not connect to Docker. Is it running?

I did some research and guessed that it was a permissions error, so I used sudo npx wp-env start and got a new error:

/home/username/Coding/wordpress/node_modules/@wordpress/env/lib/config/parse-config.js:155
		localConfig ?? {},
		             ^

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:85:18)
    at Object.<anonymous> (/home/username/Coding/wordpress/node_modules/@wordpress/env/lib/config/load-config.js:13:44)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

I have no idea why I got a syntax error in a node module; I did not change the file. I tried reinstalling the node modules, creating a new project, and clearing the npm cache, but none of that worked. For reference the version of node.js I am using is 22.21.0.

I am not sure where to go from here. Does anyone have any suggestions for how I may fix this? Did I set up docker wrong? Or should I just try to set up a LAMP stack with Wordpress manually?

Thanks in advance for any help :smiley:!

I haven't dealt with Docker all that much (I've run and continue to run Wordpress via LAMP) but one thing I might think is how have you setup Docker? Such as, going through their documentation, I'm not seeing just installing docker(dot)io as the only thing you need to do to properly set it up:
Ubuntu | Docker Docs
Are these the instructions you followed? Or have you only installed that one package via that terminal command you've used in your post?

The few times I've played with Docker, if I followed these commands in the link I posted, it usually works (haven't tried on Zorin, but I have no reason to believe it would be any different).

Maybe you need to follow these steps:

Thank you for the help! I actually looked at that install guide first and followed all the steps, however I ran into the same problem that wp-env didn't recognize docker. Therefore, I uninstalled everything and tried docker.io even though it was an "unofficial" package. I read that it was Ubuntu's package for docker that they have in their repositories. I could totally be wrong though.

Looking at the guide Forpli posted, my guess is I am running into issues because my normal user doesn't have the root permissions to use docker because I did not set that up.

Would it be easier to set it all up manually via LAMP?

Thank you! I did not see that and I did not follow that guide. I am still a newbie with all this, so I was somewhat nervous to follow those steps, as I don't fully understand how to mitigate the risks involved with changing root permissions as it suggests. Would it be safe for me to do what it suggests or should I stay away from docker until I know more?

I haven't used Docker myself maybe someone else can tell you more. But all guides are this way.
Here is another one:

Yeah, I did some more research and just ended up doing it. Sadly, it didn't fix the issue.

Therefore, I uninstalled everything I previously did. Starting with a clean slate I downloaded docker from the official repository and did all the other required steps. However, docker still won't start because "it tried to start too many times."

I think I might just abandon docker and manually upload the files I need to my Wordpress installation with my hosting company. I have a test subdomain for that reason, haha.

Thank you for your help regardless! :slight_smile: