WordPress Studio, developed by Automattic, is a powerful open-source tool for managing local WordPress development environments. While pre-built binaries exist for macOS and Windows, Linux users must build the app from source. This guide walks you through setting up and running Studio on Ubuntu, including resolving common issues I encountered.
Prerequisites
Before starting, ensure your Ubuntu system is ready with the necessary tools. Open a terminal (Ctrl+Alt+T) and follow these steps.
Step 1: Update Your System
Keep your package lists and software up to date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Git
Git is required to clone the Studio repository. Install it if you haven’t already:
sudo apt install git -y
Step 3: Install Node Version Manager (nvm)
Studio is built using Node.js, and nvm helps manage the specific Node.js version required. Install nvm with:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
After installation, reload your shell configuration to make nvm available:
source ~/.bashrc
Verify nvm is installed:
nvm --version
You should see a version number (e.g., 0.39.7). If not, close and reopen your terminal, then try again.
Step 4: Install Build Dependencies
Studio uses Electron, which requires certain libraries. Install them:
sudo apt install libgtk-3-0 libnss3 libnspr4 libxss1 libasound2 build-essential -y
Building and Running Studio
Now, let’s clone the repository, build the app, and run it.
Step 5: Clone the Studio Repository
Clone the Studio source code from GitHub into a folder (e.g., ~/studio):
git clone https://github.com/automattic/studio.git ~/studio
Navigate to the folder:
cd ~/studio
Step 6: Install Node.js and Dependencies
The repository includes a .nvmrc file specifying the required Node.js version. Install and use it:
nvm install
nvm use
Install the project’s dependencies:
npm install
If npm reports vulnerabilities, fix them:
npm audit fix
Step 7: Build the App
Run the build script to createexecutable:
npm run package
This generates an out folder containing the app (e.g., out/Studio-linux-x64).
Step 8: Fix Sandbox Permissions
Electron apps use a chrome-sandbox binary for security, which requires specific permissions. If you try running the app now, you might see an error like:
The SUID sandbox helper binary was found, but is not configured correctly.
To fix this, navigate to the output folder:
cd ~/studio/out/Studio-linux-x64
Set the correct ownership and permissions for chrome-sandbox:
sudo chown root:root chrome-sandbox
sudo chmod 4755 chrome-sandbox
Verify the permissions:
ls -l chrome-sandbox
You should see -rwsr-xr-x (the s indicates the SUID bit is set).
Step 9: Run the App
Make the executable runnable:
chmod +x studio
Launch Studio:
./studio
The app should now start, allowing you to manage local WordPress sites.
Optional: Create a Desktop Shortcut
To launch Studio from your Ubuntu app menu (e.g., GNOME), create a desktop file:
nano ~/.local/share/applications/studio.desktop
Paste the following, replacing /home/yourusername/studio with the actual path to your repo (find it with pwd in the ~/studio folder):
[Desktop Entry]
Name=Studio By WordPress.com
Comment=Local WordPress development app
Exec=/home/yourusername/studio/out/Studio-linux-x64/studio %U
Icon=/home/yourusername/studio/assets/studio-app-icon.png
Type=Application
Terminal=false
MimeType=x-scheme-handler/wpcom-local-dev;
Categories=Development;
Save and exit (Ctrl+O, Enter, Ctrl+X in nano). Make the file executable:
chmod +x ~/.local/share/applications/studio.desktop
Log out and back in, or run:
update-desktop-database ~/.local/share/applications/
Search for “Studio” in your app menu to launch it.
Troubleshooting
- Sandbox error persists: If the app still complains about
chrome-sandbox, try running it without sandboxing (less secure, use temporarily):./studio --no-sandboxUpdate the desktop file’sExecline to include--no-sandboxif needed, but aim to fix the sandbox issue. - Build fails: Ensure all dependencies are installed. Re-run
npm installandnpm run package. Check for errors in the terminal output. - App doesn’t launch: Verify all libraries are installed (
libgtk-3-0, etc.). Check the GitHub issues page (https://github.com/automattic/studio/issues) for similar problems. - Updates: To update Studio, pull the latest changes (
git pullin~/studio), then rebuild (npm install && npm run package).
Conclusion
Building WordPress Studio on Ubuntu is straightforward once you set up the environment and handle the sandbox permissions. This process lets you use a powerful tool for local WordPress development, even without official Linux binaries. For further help, consult the project’s GitHub repository or community discussions.