Installare WordPress nel tuo VPS manualmente

Stack LEMP (Linux + Nginx + MySQL + PHP)

Esta guida instala WordPress en un VPS con Ubuntu 22.04 utilizzando el stack LEMP, la combinación más rápida per WordPress.

Passaggio 1 — Installare Nginx, MySQL e PHP

apt update && apt upgrade -y
apt install nginx mysql-server php8.2-fpm php8.2-mysql php8.2-xml php8.2-curl php8.2-mbstring php8.2-zip php8.2-gd -y
systemctl start nginx mysql php8.2-fpm
systemctl enable nginx mysql php8.2-fpm

Passaggio 2 — Crearee database MySQL

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'TuPasswordSicura';
GRANT ALL ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Passaggio 3 — Scaricare e installare WordPress

cd /var/www
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress tudominio
chown -R www-data:www-data tudominio
chmod -R 755 tudominio

Passaggio 4 — Configuraree Nginx per WordPress

Crea el file /etc/nginx/conf.d/tudominio.conf:

server {
  listen 80;
  server_name tudominio.com;
  root /var/www/tudominio;
  index index.php;

  location / { try_files $uri $uri/ /index.php?$args; }

  location ~ \.php$ {
    fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

Luego: nginx -t && systemctl reload nginx

Passaggio 5 — Completar instalación da el navegador

Ve a http://tudominio.com e sigue el asistente de instalación de WordPress con los datos della database del Passaggio 2.

✅ WordPress instalado. Accedi al panel en tudominio.com/wp-admin. Per agregar HTTPS, instala Certbot: apt install certbot python3-certbot-nginx -y && certbot --nginx -d tudominio.com