Skip to content
StaticScope
Overview
Get StaticScope

Publish to your own server

Push the static site over SFTP to a folder you control, with host key pinning and atomic releases.

Publishing Updated 21 November 2026 7 min read

The Your server add-on publishes over SFTP to a folder on a machine you already pay for. A Cloudways app, a cPanel account, a droplet, a VPS: if it has SSH with SFTP and a web server, it will serve a static site.

Nothing on the server outside that folder is touched. The add-on does not install anything, edit a vhost, restart a service or need root. The web server, DNS and TLS stay yours.

Connection methods

A server I already use asks for details you have: host, port, user, key or password, folder and address.

A new server generates an Ed25519 key pair and a single setup command. Run it as root on a new Debian or Ubuntu server and it creates a deploy user, a releases folder, a shared folder, a current symlink, a placeholder index.html and an authorized_keys entry. It prints Caddy and nginx snippets and stops there: no web server install, no vhost edit, no TLS.

Fill in the form before copying the command, because the command is generated from the domain and folder you save. If WordPress runs on your laptop, put the server’s IP in Server and the domain in Site address, or the snippets name the wrong host.

Connection details

FieldWhat it wants
ServerHostname or IP. IPv6 literals work.
Port1–65535, default 22.
UsernameThe SSH or SFTP account. A deploy user is best.
Sign in withSSH key (recommended) or password. One secret is kept.
Private keyPaste it with its BEGIN and END lines. A passphrase is optional.
Folder on the serverAbsolute path, starting with /, at least two segments.
Site addressWhat visitors type, including any subfolder.
Publishing styleAutomatic, Direct or Atomic releases.
RollbackKeep a copy of replaced files. Direct mode only.

The connection uses phpseclib’s SFTP client and never runs a shell command. Plain FTP will not work, and neither will an SSH server with the SFTP subsystem turned off. Outbound SSH from your WordPress host has to be open, which some shared hosts block.

The folder

Point it at the folder the web server already serves, such as /home/user/public_html or /var/www/example.com/public_html. For a subfolder site, choose the folder mapped to that subfolder and include the subfolder in the address.

The path policy is narrow. / is refused, as are paths under /bin, /boot, /dev, /etc, /lib, /proc, /root, /run, /sbin, /sys and /usr. Relative paths, .., control characters and paths over 1024 characters are refused too. Every path inside the build is checked again before it is uploaded, so a build cannot write outside the folder.

A folder named current that is not a symlink is refused rather than replaced. Move it aside, or point the add-on at the web root and publish directly.

Keys, fingerprints and trust

The first connection shows the server’s SHA256 fingerprint, in the same form ssh-keygen -lf prints, and sends nothing until you select Trust this server. That is the moment to compare it with what your host shows. Nothing has been authenticated at that point, so a wrong fingerprint costs you nothing but a retry.

A later mismatch stops everything with “This server’s identity has changed”, uploads nothing and does not send your key. That is what a man in the middle looks like, and also what a rebuilt server looks like. Check which one you are dealing with before trusting the new key.

Private keys, passphrases and passwords are encrypted with the site’s salts and never displayed again. STATICSCOPE_SERVER_HOST_KEY pins the fingerprint in code, and the rest of the fields have constants too: STATICSCOPE_SERVER_HOST, _PORT, _USER, _AUTH, _PRIVATE_KEY, _PASSPHRASE, _PASSWORD, _FOLDER, _PUBLIC_URL and _MODE. The folder constant is STATICSCOPE_SERVER_FOLDER; STATICSCOPE_SERVER_PATH is the plugin directory and will not do what you want.

Permissions

Use an account that can write to this one folder and little else. The generated setup command creates exactly that. Root works and is a bad idea: a stolen key should not be able to do anything outside the site.

The web server’s user needs read access to the files, so the usual arrangement is a shared group and directories at 775 and files at 664, or 755 and 644 with the deploy user owning them. The connection check writes a file and reads it back, which catches a folder the deploy user cannot write to. A 403 later is usually ownership or a password prompt, not the upload.

Direct or atomic releases

Automatic, the default, uses atomic releases when the folder has a current symlink and a releases folder, and direct publishing otherwise.

Direct publishing uploads only the files that changed into a hidden staging folder inside the site folder, then moves them into place with renames. Assets go first, pages last. Nothing live changes before the move, so a dropped connection never leaves half a page published. Replaced files are kept in a hidden backup folder when rollback is on, and the newest four are retained.

Atomic releases upload the whole site into releases/<timestamp>-<hash>/, then swaps current by renaming a temporary symlink over it. Every publish is complete and the switch is instant, at the cost of uploading everything. The newest four releases are kept. The web server must serve <folder>/current; if the vhost points at the folder itself, the site shows a listing and direct mode is the answer.

Direct is faster on a slow link; releases are complete every time. That is the trade.

The address check that blocks publishing

If the prepared site was built for a different address, the publish screen says so and refuses:

The prepared site was built for a different address. Build it again so links point to address.

There is no button to push it anyway, which is the right behaviour. Absolute links in a stale build send visitors to the old domain.

The other refusals work the same way: an untrusted host key, a preview older than the content or the code, and a build containing a path outside the folder.

Rollbacks

Rollback puts the previous version back on the server and changes nothing in WordPress, so the next publish brings the newer files again. In releases mode it switches current to the previous release, which only works while that release still exists. In direct mode it moves the kept copies back and deletes the files that publish added; if some of those files were cleaned up already, the rollback is partial and says so.

One level only. A successful rollback is marked in the history, so it cannot be undone itself. Three history entries are kept, for reference rather than for stepping back through.

When visitors can’t see it

  • Nothing answered. DNS, the domain or the certificate. A new domain can take a few minutes.
  • 404. The document root is not the folder you chose, or it does not serve index.html.
  • 403. Folder permissions, basic auth or an IP allow list.
  • A file listing. The web server is showing a directory. Point it at index.html and turn listings off.
  • The wrong content. The address serves a different folder. The check catches this and names the URL.
  • The current symlink answers with nothing. The vhost is not following it. Serve current or switch to direct.

A publish still completes when the public check fails; the screen will not mark the site as live.

When plain rsync is a better fit

This add-on exists so a WordPress editor can press Publish without a terminal. If none of your publishing starts in WordPress, rsync is simpler and cheaper.

  • You already have CI. A GitHub Action running rsync -az --delete from the published branch does the same job with no database involvement.
  • You need a delta protocol. rsync’s rolling checksum beats per-file hashing for a very large library over a slow link.
  • You deploy to several servers. One StaticScope environment is one folder on one host. A loop in CI is the better tool.
  • Your host blocks outbound SSH. Then this add-on cannot connect, and a push from CI is the workaround.

What you lose is the live check, the fingerprint prompt and the rollback history. For a site where a person presses Publish, those are worth more than the extra control.

WP-CLI

wp staticscope server status
wp staticscope server test
wp staticscope server publish
wp staticscope server rollback
wp staticscope server generate-key

test refuses an untrusted host key and prints the fingerprint, because a terminal cannot ask you to compare one. Trust it on the screen first. publish applies the same checks as the button, including the address refusal. generate-key prints the public half and stores the private half encrypted.

Who can use it

The screen is manage_options only, with no publish-only capability and no filter to add one. Publishing means holding the ability to change the server settings, including the key.

Next