How to Set a Document Root in Plesk

Setting the correct document root in Plesk is one of the most important website configuration tasks for anyone managing a domain, subdomain, or application on a hosting platform. The document root tells the web server where your site files are stored and which directory should be served when a visitor opens your domain. If this path is wrong, your website may show the wrong content, load a default page, or return an error even though the files are present on the server.

In Plesk, the document root is usually configured per domain or subdomain and can be changed from the hosting settings. This is useful when you want to move a site into a different folder, install an application in a custom directory, point a subdomain to a separate location, or adjust the web root for a framework such as Laravel, Symfony, WordPress, or another PHP-based project. The steps below explain how to do this safely and what to check before and after the change.

What a document root means in Plesk

The document root is the public directory that the web server uses as the starting point for a website. For example, if a domain is configured to use httpdocs, then files placed in that directory are the ones shown to visitors when they access the domain.

In hosting environments that use Plesk, each domain and subdomain can have its own document root. This makes it easy to separate websites, test environments, and application directories without changing the main server configuration manually. Depending on the web server stack, Plesk can work with Apache, Nginx, or both, but the document root concept stays the same: it defines the path to the publicly accessible web files.

Common examples include:

  • Main domain: the document root usually points to httpdocs.
  • Subdomain: the document root may point to a separate folder such as subdomains/blog/httpdocs or another custom path.
  • Application install: the web root may need to point to a folder like public for modern frameworks.

When you may need to change the document root

There are several practical reasons to update the document root in Plesk. In managed hosting environments, this is often needed during site migrations, application setup, or website restructuring.

Typical use cases

  • You installed a web application in a folder other than the default one.
  • You want a subdomain to serve content from a separate directory.
  • You moved website files and need the domain to point to the new location.
  • Your framework requires a public folder such as public or web.
  • You want to keep staging and production files in different directories.
  • You are cleaning up an old structure and want a simpler hosting layout.

If you use a European hosting platform with multiple projects on one account, setting the correct document root also helps keep websites organized and reduces the risk of serving the wrong files to visitors.

Before you change the document root

Before updating the path, check a few details to avoid downtime or broken links. A document root change is usually simple, but it affects how the site resolves in the browser.

Check these points first

  • Make sure the target folder already exists.
  • Confirm that the folder contains the correct website files.
  • Verify file permissions so the web server can read the content.
  • Check whether the site uses PHP, rewrite rules, or custom application routing.
  • Back up the current site or at least the web root configuration.
  • Confirm whether the domain or subdomain is already assigned to another directory.

If your website uses .htaccess, rewrite rules, or an application bootstrap file, changing the document root may require additional adjustments. For example, some apps expect all public traffic to go through a specific folder, while the rest of the source code stays outside the web root.

How to set a document root in Plesk

The exact labels may vary slightly depending on the Plesk version and hosting permissions, but the process is usually straightforward. You can change the document root from the domain or subdomain hosting settings.

For a domain

  1. Log in to Plesk.
  2. Go to Websites & Domains.
  3. Select the domain you want to edit.
  4. Open Hosting Settings.
  5. Find the Document root field.
  6. Enter the new directory path, for example httpdocs/public or another folder.
  7. Save the changes.

For a subdomain

  1. Log in to Plesk.
  2. Open Websites & Domains.
  3. Select the relevant subdomain.
  4. Click Hosting Settings.
  5. Update the Document root to the desired folder.
  6. Save the configuration.

After saving, Plesk updates the web server configuration for the selected site. In many cases the change applies immediately, but you may need to wait a short time for the web service to reload depending on the hosting setup.

Example document root paths

Different websites and applications require different folder structures. Below are examples that are commonly used in Plesk hosting environments.

  • Default domain root: httpdocs
  • Application public folder: httpdocs/public
  • Subdomain folder: subdomains/blog/httpdocs
  • Separate project directory: httpdocs/site
  • Custom staging path: staging.example.com/httpdocs or a similar folder assigned in hosting settings

The exact path format depends on how your hosting account is structured. In Plesk, the interface usually helps you choose a valid directory, but it is still important to understand what the path means so you do not point the site to the wrong location.

How document root affects Apache and Nginx

On many hosting platforms, Plesk uses Apache, Nginx, or both together. The document root tells the server stack where the website files live, regardless of which web server handles the request first.

In an Apache-based setup, the document root is used to resolve the site files and apply rewrite rules from files such as .htaccess. In a setup with Nginx in front of Apache, Nginx may handle static content and reverse proxy requests, but the document root still defines the file location used by the site configuration.

This matters because:

  • Rewrite rules must match the new folder structure.
  • Static assets need to be inside or accessible from the new root.
  • Application entry points may need to be adjusted if they assume a different public directory.

If your site does not load correctly after the change, the issue may be caused by application routing rather than the document root itself.

Best practices when changing the document root

To keep the website stable, follow a few simple best practices whenever you adjust the root directory in Plesk.

Recommended practices

  • Keep the public files separate from private files: if possible, place source code outside the public directory and expose only the web-facing folder.
  • Use a consistent directory structure: this makes future maintenance easier.
  • Do not point the document root to the wrong level: if the app uses a public folder, do not point directly to the project base directory unless the app is designed for it.
  • Check permissions after moving files: the web server must be able to read the content.
  • Test the site after the change: open the domain, check internal pages, and verify assets and forms.

For managed hosting customers, it is often better to update the document root during a planned maintenance window if the site is already in production.

Common problems after changing the document root

Sometimes the new document root works only partially, or the site fails to load as expected. Most issues are easy to diagnose once you know what to check.

Site shows a default page or old content

This usually means the new folder does not contain the correct index file, or the site is still serving files from a different path. Check that the target directory has an index.html, index.php, or the expected application entry point.

404 errors appear on internal pages

This may happen when rewrite rules or application routing are not adjusted for the new directory. Review your .htaccess file, application base URL, or routing configuration.

Permissions or access denied issues

If the web server cannot read the new folder, the site may show a permission error. Confirm that file and directory permissions are correct and that ownership matches the hosting account.

Assets do not load correctly

If CSS, JavaScript, or image files stop loading, the application may use hardcoded paths that still point to the old location. Update those references if needed.

Blank page or application error

Some PHP applications depend on a specific root structure. If the document root points to the wrong folder, the app may fail during bootstrap. In that case, confirm the folder required by the application developer.

How to verify the document root is correct

After changing the setting, test the site carefully to make sure the new configuration works as intended.

Verification checklist

  • Open the domain in a browser and confirm the expected homepage loads.
  • Check a few internal pages, not just the homepage.
  • Verify that images, stylesheets, and scripts load properly.
  • If the site uses PHP, confirm that the application responds normally.
  • Check whether redirects or canonical URLs still point to the correct location.
  • Review any error logs if the page returns a server error.

For websites hosted in a European environment where users may access the site from multiple countries, testing from more than one browser or network can help confirm that the change behaves consistently.

Document root settings for common platforms

Different website platforms often require different root folders. The examples below are useful when you manage domains and websites in Plesk.

WordPress

Standard WordPress installations usually work with the default document root if WordPress is installed directly in the site directory. If WordPress is installed in a subfolder, the root should point to that folder only if it is intended to be public.

Laravel

Laravel typically expects the web root to point to the public folder. Setting the document root to that folder helps keep sensitive application files outside the public web area.

Symfony

Symfony applications also usually require a public directory such as public. Make sure the root points there instead of the project base directory unless the deployment method says otherwise.

Static website

For a simple HTML site, the document root can point to the folder that contains index.html and related assets. In many cases this is the default httpdocs folder.

Security considerations

The document root is not just a technical setting; it also affects website security. If the root is set incorrectly, files that should remain private may become publicly accessible.

To reduce risk, keep configuration files, logs, backups, and application source files outside the public directory whenever possible. Only place the files needed by the browser inside the document root. This is especially important for PHP applications and custom web projects.

Also review:

  • whether directory listing is disabled,
  • whether sensitive files are excluded from the web root,
  • whether old test folders are still accessible,
  • whether backup archives were accidentally placed in a public path.

Frequently asked questions

What is the default document root in Plesk?

For many domains, the default document root is httpdocs. Subdomains may have their own folder structure depending on how they were created.

Can I set a different document root for each subdomain?

Yes. In Plesk, each subdomain can usually have its own hosting settings and its own document root, which makes it easy to separate websites or projects.

Do I need to restart the server after changing the document root?

Usually no. Plesk applies the change through the hosting configuration. In most cases the web server updates automatically, though the exact behavior depends on the hosting setup.

Why does my site break after changing the document root?

The most common causes are incorrect folder paths, missing index files, permission issues, or application rewrite rules that still point to the old structure.

Can I point the document root to a public folder inside my application?

Yes, if the application is designed for that structure. Many modern frameworks expect the web root to point to a folder such as public.

Where can I change the document root in Plesk?

You can usually change it from Websites & Domains > select the domain or subdomain > Hosting Settings > Document root.

Summary

Setting the document root in Plesk tells the hosting platform which folder should be served as the public website directory. It is a simple but important step when managing domains, subdomains, and application deployments. By choosing the correct folder, checking permissions, and testing the site after the change, you can avoid common issues such as 404 errors, missing assets, or broken application routing.

For most hosting scenarios, the safest approach is to keep the document root aligned with the application structure, use clear folder names, and verify that only the intended files are publicly accessible. This helps maintain a stable, secure website setup in Plesk-managed hosting environments.

  • 0 Users Found This Useful
Was this answer helpful?