sudo mkdir -p /var/www/example.com/html

Category: VPS Management

sudo mkdir -p /var/www/example.com/html

Create the web root for a site

mkdir -p creates the document root for example.com, including any missing parent directories — the standard location nginx serves static files from. The -p flag makes the command idempotent: it succeeds even if the directory already exists. Ownership typically moves to www-data next.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.