How to Set Up a Web Development Environment on Linux (Full Stack Ready)
If you're a web developer working with HTML, CSS, JavaScript, PHP, or frameworks like Laravel or React — setting up a proper development environment on Linux is the first step to productive and efficient coding.
In this guide, we’ll walk you through setting up a complete web dev stack with tools like Apache/Nginx, PHP, MySQL, Git, and Node.js on a Linux server or local machine.

Powered by
Vastrox.com — helping developers build fast, secure, and scalable digital projects.
Why Use Linux for Web Development?
Linux offers a flexible, fast, and developer-friendly environment. It's the preferred OS for modern web hosting, cloud platforms, and server-side development — including Vastrox-powered infrastructure.
Benefits include:
- Native support for web technologies (PHP, Node, Python)
- Easy version control and automation
- Better performance for local and remote development
- Seamless deployment to VPS/cloud servers
What You’ll Need
- A Linux-based OS (Ubuntu, Debian, AlmaLinux, etc.)
- Terminal access with sudo privileges
- Internet connection for package installations
Step 1: Install Apache or Nginx
Choose a web server based on your project type.
Option 1: Apache
sudo apt install apache2 (Debian/Ubuntu)
sudo systemctl enable apache2
sudo systemctl start apache2
Check if it's running:
Visit
http://localhost or
http://your-server-ip
Option 2: NGINX
sudo apt install nginx
sudo systemctl enable nginx
sudo systemctl start nginx
Step 2: Install PHP (for dynamic websites)
Install the PHP engine and common modules:
sudo apt install php php-cli php-curl php-mysql php-gd php-mbstring php-xml
Check PHP version:
For Apache integration:
sudo apt install libapache2-mod-php
sudo systemctl restart apache2
For NGINX, configure PHP-FPM:
sudo apt install php-fpm
Configure nginx.conf or site config to use fastcgi_pass
Step 3: Install MySQL or MariaDB (for databases)
Install MySQL:
sudo apt install mysql-server
sudo mysql_secure_installation
Install MariaDB (alternative to MySQL):
sudo apt install mariadb-server
Use mysql CLI to create databases and users.
Step 4: Install Node.js + npm (for front-end tools)
Install Node.js and npm:
sudo apt install nodejs npm
Or install the latest version using NodeSource:
bash
CopyEdit
<span><span>curl -fsSL
https://deb.nodesource.com/setup_18.x | sudo -E bash -<br>sudo apt install -y nodejs<br></span></span>
Verify installation:
Step 5: Install Git for Version Control
Configure Git:
git config --global user.name "Your Name"
git config --global user.email "
you@example.com"
Bonus Tools for Developers
Optional but highly recommended:
- Composer (for PHP dependency management):
sudo apt install composer
npm install -g gulp-cli or npm install -g webpack
- Docker (for containers and isolated stacks):
sudo apt install docker.io
Deploying with Vastrox
Once your dev stack is ready, deploy your apps to production using
Vastrox.com:
- 1-click deployment for Laravel, React, and Node
- Pre-configured environments with PHP, MySQL, and SSL
- Secure SSH and Git-based workflows
- Global CDN, firewall, and auto-backup integrations
Build locally — deploy globally with Vastrox.
Final Checklist
- Apache or NGINX is running
- PHP is working and parsing .php files
- Database is installed and secured
- Node.js and npm are installed
- Git is configured for your projects
- Optional dev tools (Composer, Docker, VS Code)
Conclusion
You’ve now set up a complete
Linux web development environment — ready to build modern websites, APIs, and full-stack applications.
For more guides on deploying to production, optimizing your stack, and securing your code, check out
Vastrox.com.
We help developers move fast — and build securely.