
September 11, 2026
10 min read
By Kokil Thapa | Last reviewed: September 2026
You picked Ubuntu because it matches most production servers and CI runners. This Ubuntu for Developers Guide walks through a stack I ship daily: PHP 8.5, Laravel 13, Node.js 26 LTS, MySQL 9.7 or PostgreSQL 18, Redis 8.10, and Docker on Ubuntu 24.04 LTS. If you already run a Ubuntu server for Laravel or WordPress, the same patterns apply on your laptop. The goal is one environment that behaves like production, not a fragile local-only setup.
Which Ubuntu version should developers use in 2026?
Ubuntu 24.04 LTS (Noble Numbat) is the default choice for new machines in 2026. It is supported until 2029 with standard security updates. Ubuntu 22.04 LTS still runs on many VPS plans and client servers I maintain. Both work fine for PHP and Laravel work.
Pick Desktop if you want GNOME, a browser, and IDE on one box. Pick Server if the machine lives in a data centre or runs only services. For remote work from Kathmandu or abroad, Server plus SSH from your laptop is often cheaper than a heavy local VM.
| Edition | Best for | Trade-off |
|---|---|---|
| Ubuntu 24.04 Desktop | Local dev, design review, daily driver | Uses more RAM; extra packages you may not need |
| Ubuntu 24.04 Server | VPS, staging, production, CI runners | No GUI; you work over SSH |
| Ubuntu 22.04 LTS | Existing hosts, managed VPS defaults | Newer PHP repos target 24.04 first |
| WSL2 on Windows | Windows users who want Linux tooling | File I/O and Docker networking differ from bare metal |
Before you install anything, run a full update. This matches what I do on every fresh VPS before Laravel or WordPress goes live.
sudo apt update && sudo apt full-upgrade -y
sudo apt install -y curl wget git unzip build-essential software-properties-common
Set your timezone if the server sits in Nepal or serves Nepali users. Use Asia/Kathmandu so cron jobs and log timestamps align with business hours.
sudo timedatectl set-timezone Asia/Kathmandu
timedatectl
How do you install PHP 8.5 and Composer on Ubuntu for Laravel 13?
Laravel 13 needs PHP 8.3 or higher. PHP 8.5 is the current anchor version in 2026. Laravel 12 still runs on PHP 8.2 and is supported until February 2027. On greenfield projects, standardise on 8.5 unless a legacy host blocks you.
I add the Ondřej Surý PPA on Ubuntu. It is the standard path for multiple PHP versions side by side. Full install steps live in the dedicated PHP on Ubuntu guide.
- Add the PPA and install PHP 8.5 with common extensions.
- Switch the CLI default with
update-alternativesif you keep older versions. - Install Composer 2.10 globally.
- Verify versions before you clone any project.
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install -y php8.5 php8.5-cli php8.5-fpm php8.5-mysql php8.5-pgsql \
php8.5-redis php8.5-xml php8.5-mbstring php8.5-curl php8.5-zip php8.5-intl \
php8.5-bcmath php8.5-gd php8.5-readline
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version
php -v
Create a new Laravel 13 app once PHP and Composer are ready. Use the official installer or composer create-project.
composer global require laravel/installer
laravel new myapp
cd myapp && php artisan serve
On production Laravel apps I maintain, opcache and realpath cache matter more than micro-optimisations in PHP code. Tune /etc/php/8.5/fpm/php.ini after your first deploy, not on day one of local setup.
How do you set up Node.js 26, databases, and Redis on Ubuntu?
Modern Laravel front ends use Vite 8.x. That needs Node.js 26 LTS and npm 12. Install Node from NodeSource rather than the outdated Ubuntu default package.
curl -fsSL https://deb.nodesource.com/setup_26.x | sudo -E bash -
sudo apt install -y nodejs
node -v
npm -v
Pick one primary database per project. MySQL 9.7 remains the common choice on shared hosting. PostgreSQL 18 is excellent for Laravel apps with JSON columns or strict constraints. Redis 8.10 handles cache, sessions, and queues.
MySQL install on Ubuntu is documented in the MySQL on Ubuntu tutorial. For PostgreSQL with Eloquent, see the PostgreSQL for Laravel developers guide.
sudo apt install -y mysql-server
sudo mysql_secure_installation
sudo apt install -y postgresql postgresql-contrib
sudo -u postgres createuser --interactive
sudo apt install -y redis-server
sudo systemctl enable redis-server
redis-cli ping
Point your Laravel .env at local services. Match driver names to the extensions you installed.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myapp
DB_USERNAME=myapp
DB_PASSWORD=secret
CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
How do you configure Nginx and Docker for local and staging environments?
php artisan serve is fine for quick checks. It is not how I run staging or production. Nginx plus PHP-FPM matches real hosting and catches path and permission bugs early.
Follow the Nginx on Ubuntu install guide for package setup. A minimal site block for a Laravel app in /var/www/myapp/public looks like this.
server {
listen 80;
server_name myapp.test;
root /var/www/myapp/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.5-fpm.sock;
}
}
Add a local hostname in /etc/hosts if you are not using Laravel Valet or Docker-based reverse proxies.
Docker isolates services when you juggle multiple client projects. The Docker on Ubuntu guide covers engine install. Laravel Sail wraps Docker for teams that want one command to boot the stack.
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
On a booking platform like Adventure Third Pole Trek, I run queue workers and scheduler via systemd or Supervisor on Ubuntu. Docker handles local parity; systemd handles long-running processes on the VPS.
What security and maintenance steps matter before production?
Developers often skip hardening on laptops. That habit follows you to production. Lock down SSH, enable a firewall, and keep packages current before the first deploy.
- Create a sudo user; disable root SSH login.
- Enable UFW: allow OpenSSH, then HTTP and HTTPS only when needed.
- Install fail2ban for brute-force protection.
- Turn on unattended security upgrades on servers.
- Set correct ownership on
storage/andbootstrap/cache/.
The Ubuntu security hardening guide and security updates guide cover details. File permissions break Laravel after every bad chmod -R 777. Read Ubuntu file permissions explained before you “fix” upload errors.
sudo adduser deploy
sudo usermod -aG sudo deploy
sudo ufw allow OpenSSH
sudo ufw enable
sudo apt install -y fail2ban
Schedule backups and cron on the same user context as deployment. Stale paths in crontab are a recurring production bug I see after symlink-based deploys. The Ubuntu cron jobs guide shows how to pin absolute paths.
How do you deploy Laravel and WordPress projects from Ubuntu dev to production?
Local Ubuntu should mirror production Ubuntu. Same PHP minor version, same extensions, same queue driver. Surprises show up when staging runs PHP 8.1 and production runs 8.5.
I deploy most Laravel sites with Deployer 7 and GitLab CI. The pipeline runs tests, builds front-end assets with Vite, then releases to a symlinked directory on Ubuntu. PHP-FPM reload clears opcache after each swap. Sister legal-tech sites on shared EC2 use this exact pattern.
Environment variables belong in .env on the server, never in Git. The Ubuntu environment variables guide explains persistence across shells and systemd units. For JSON API payloads during integration work, keep the JSON formatter tool open in a tab.
WordPress 7.1 and WooCommerce 11.1 run well on the same LAMP or LEMP stack. Point the web root at public_html or map a vhost to the WordPress directory. Magento 2.4.x and Shopify theme work still benefit from Linux tooling even when production sits elsewhere.
Performance tuning on Ubuntu covers opcache, MySQL buffers, and Redis memory limits. See speed up Ubuntu performance before you upsize a VPS. Network changes on cloud hosts go through Netplan — the Ubuntu Netplan tutorial saves hours when a static IP or secondary NIC appears after reboot.
Official references worth bookmarking: the Ubuntu Server documentation, Laravel 13 deployment docs, and Node.js release schedule. They stay current when distro packages lag by a few weeks.
If you need hands-on help tuning Ubuntu for client workloads, see Linux system administration in Nepal or broader web development services. Full-stack hiring context lives in the full-stack developer in Nepal and Laravel developer in Nepal articles. Desktop users should read the Ubuntu desktop complete guide for GNOME tweaks that do not fight your terminal workflow.
Key Takeaways
- Standardise on Ubuntu 24.04 LTS with PHP 8.5, Composer 2.10, and Node.js 26 LTS for new Laravel 13 work.
- Install Nginx, PHP-FPM, Redis, and one database locally so staging matches production behaviour.
- Harden SSH, enable UFW, and install fail2ban before exposing any dev box to the internet.
- Use Docker for multi-project isolation; use Deployer 7 or similar for zero-downtime Ubuntu releases.
- Fix permissions with intent — never chmod 777 on Laravel
storage/directories. - Reload PHP-FPM after every deploy so opcache serves fresh code, not stale bytecode.
People Also Ask
Is Ubuntu better than macOS or Windows for web development?
Ubuntu matches most Linux production servers, so deploy surprises are rarer. macOS is strong for local dev with Homebrew. Windows plus WSL2 closes much of the gap. For PHP and Laravel teams, Ubuntu on a VPS plus Ubuntu or WSL locally is the most predictable combo in 2026.
Can I run multiple PHP versions on the same Ubuntu machine?
Yes. The Ondřej Surý PPA installs 8.3, 8.4, and 8.5 side by side. Point Nginx fastcgi_pass at the correct FPM socket per site. Use update-alternatives to switch the CLI default when you run Composer or Artisan.
How much RAM does an Ubuntu developer machine need?
8 GB works for light PHP and Vue work. 16 GB is comfortable with Docker, Chrome, and an IDE open. Queue workers, Elasticsearch, or Android emulators push you toward 32 GB. On budget VPS plans in Nepal, start at 2 GB for staging only — not for Docker-heavy local parity.
Do I need a separate staging server on Ubuntu?
For client-facing Laravel or WooCommerce projects, yes. Staging on the same Ubuntu version as production catches extension gaps and permission bugs. A small 2 vCPU / 4 GB VPS often costs Rs 1,500–3,000/month (~USD 11–22), which is cheap compared to a bad deploy.
Build your Ubuntu dev environment with confidence
This Ubuntu for Developers Guide reflects stacks I run on legal-tech portals, eCommerce builds, and booking systems shipped since 2010. Start with 24.04 LTS, mirror production services locally, harden before you expose ports, and automate deploys once the app earns traffic. When you want someone who handles code, server, and deploy on one Ubuntu pipeline, contact us or browse the portfolio for live examples.
Frequently Asked Questions
0 Comments
Leave a comment
Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

