Deployment Settings

The Deployment Settings determine how and where the static version of your WordPress site is deployed.

The selected deployment method can also be configured with the STAATIC_DEPLOYMENT_METHOD environment variable. Supported values are:

Value Method
filesystem Local Directory
aws Amazon S3 (or compatible)
github GitHub
netlify Netlify
sftp SFTP Server
staatic Staatic Cloud
zipfile Zipfile

The default deployment method is filesystem. Environment-provided settings lock the corresponding fields in the settings UI unless environment lookup is disabled with STAATIC_DISABLE_ENV.

Deployment Method

Staatic supports the following deployment methods out of the box:

Note: if you have a Staatic Cloud subscription, the Staatic Premium plugin on your managed WordPress instance will be preconfigured to deploy to Staatic Cloud.

Local Directory

The Local Directory deployment method allows you to deploy your static site to a directory on the same server hosting your WordPress installation. The chosen directory is usually configured as the webserver’s document root or “public_html” for the static site.

The default target directory is inside the WordPress uploads directory at staatic/deploy. Staatic creates the target directory when possible, but it must be writable. Do not point this method at the WordPress installation directory or a parent of it; the deployment process mirrors static output into the target and can remove files that are not part of the build.

More information on the Local Directory method

Amazon S3 (or compatible)

Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis.

The Amazon S3 (or compatible) deployment method allows you to deploy your static site to Amazon S3, or any S3-compatible provider, optionally accelerated by Amazon CloudFront.

More information on the Amazon S3 (or compatible) method

GitHub

GitHub serves as a prominent platform for hosting code and managing version control, facilitating collaborative project work among multiple contributors. A notable feature of GitHub, GitHub Pages, enables users to host their websites directly from a GitHub repository. This is especially advantageous for static websites, offering WordPress users a reliable option to boost their site’s performance and security.

The GitHub deployment method allows you to deploy your static site to GitHub or GitHub Pages.

The GitHub token can be configured in Staatic, or supplied through GH_TOKEN or GITHUB_TOKEN. Commit messages can include {publicationId}, {buildId}, {deploymentId}, and {userId} placeholders.

More information on the GitHub method

Netlify

Netlify is a web hosting and automation platform that accelerates development productivity. By unifying the modern decoupled web elements from local development processes to advanced logics, Netlify is offering an amazingly faster way to ensure much more performant, scalable, and secure websites and applications.

The Netlify deployment method allows you to deploy your static site to Netlify.

Staatic generates a netlify.toml file for Netlify deployments so redirects and headers can be represented in the deployed output.

More information on the Netlify method

SFTP Server

The SFTP Server deployment method allows you to securely deploy your static site to a remote server using the Secure File Transfer Protocol (SFTP). This method is ideal for users who want to host their static site on a remote server while ensuring that the file transfers are encrypted.

The deployment can be configured with your server’s hostname, port, target directory, and user authentication credentials, supporting both password and SSH key-based authentication.

SFTP deployments track deployed files in deployment metadata so stale files can be removed on later deployments.

More information on the SFTP Server method

Staatic Cloud

The Staatic Cloud deployment method is available with Staatic Premium and deploys your static site to Staatic Cloud. On managed Staatic Cloud WordPress instances, this deployment method is preconfigured.

Staatic Cloud supports preview publications, so the Preview URL setting is available when this method is active.

Uploads Sync

By default Uploads Sync is disabled. The option is shown when Staatic Cloud is the selected deployment method and can also be configured with the STAATIC_UPLOADS_SYNC environment variable.

When enabled, Staatic registers the media in the WordPress uploads directory straight from disk instead of crawling each file. On Staatic Cloud hosted sites the files are then synchronized server-side; elsewhere they are uploaded from disk by the plugin. In both cases the media is never requested from WordPress, which is where the time is saved on sites with large media libraries.

While the option is enabled, the uploads directory is excluded from Additional Paths processing, because the media is already included through the uploads index.

Uploads Sync applies to full live and preview publications. Partial publications, selective publications, and redeployments are unaffected and keep crawling or reusing resources as before.

The following files in the uploads directory are skipped:

Skipped Reason
Symbolic links Only regular files inside the uploads directory are published.
Files and directories whose name starts with a dot Hidden files are not part of the site’s media.
Files larger than 1 GiB Above the size limit for a synchronized file.
Executable and configuration file types, such as .php, .sh, .sql, .env, .key, .htaccess These must not be published as static files.
A staatic directory inside uploads, and known plugin cache, log, backup, and export directories Not site media.
Files whose resulting URL or deployed path is too long for the deployment target The target cannot store the full path.
Files excluded by the Exclude URLs setting or by custom crawl rules Excluded URLs are not published, whether they are crawled or synchronized.

These directories are matched at the top level of the uploads directory only. staatic is the default location of the Work Directory; if you have moved the work directory to another location inside the uploads directory, its contents are not skipped. Keep the work directory at its default location, or outside the uploads directory altogether.

Before a publication starts, Staatic checks that the uploads directory is readable and that the Staatic Premium database migration has been applied. Both are reported as deployment method validation errors.

While a publication runs, the publication status shows how many media files were registered from disk on a separate line. These files are not counted as pages still to fetch, so crawl progress keeps reporting pages fetched against pages to fetch.

Note: on a Staatic Cloud hosted site, crawled resources are synchronized server-side as well, but only when the Work Directory is located inside the WordPress directory. If it is not, Staatic records a notice in the publication log and uploads the crawled resources from the site instead; the media is still synchronized server-side.

Note: if the uploads directory cannot be identified in the destination URL space, for example when the uploads URL has no distinct path of its own once the destination URL is applied, Staatic declines the server-side sync altogether and records a notice in the publication log. Both the media and the crawled resources are then uploaded from the site. In either case the publication still completes; it only takes longer.

Note: This functionality is part of Staatic Premium Edition.

Zipfile

The Zipfile deployment method allows you to package your static site as a zip archive file. Once the site is published, the zipfile can be downloaded directly from the WordPress admin interface. This method is ideal for users who want to manually distribute or upload the static site to another server or hosting provider.

Zipfile does not run Staatic’s normal deployment tasks. It generates an archive for download instead of syncing files to a remote target.

More information on the Zipfile method

Sync behavior and retained files

Most deployment methods synchronize the target to match the latest static build. Local Directory, Amazon S3, and GitHub deployments can remove target files that are no longer present in the build unless they are configured as retained paths. SFTP also removes stale files, based on the files tracked in its deployment metadata.

Review each deployment method’s retain-path or target-path settings before publishing to a directory, bucket, branch, or server path that contains files not managed by Staatic.