As Publii is a desktop application it doesn't need to be connected to your website's server when you're making modifications or adding content; instead, whenever your changes are ready to go live you'll just need to hit the Sync Your Website button in the bottom-left of the Publii app:
You can sync your website as often or as little as you wish; each time you sync Publii will compare your local files with the ones on the server and will only upload changes, so after the first sync everything will run faster. Before you can sync your site though, you will need to enter your server details into the app. Don't worry if you do not have a server yet; you can still use Publii to create your website and add your server information later.
Server Configuration Options
Server configuration begins with two universal options:
- Domain - This should be the home URL of your site e.g. www.mysite.com; you can also choose between http:// or https:// if necessary.
- Protocol - Sets the type of FTP (File Transfer Protocol) or cloud solution your server uses; this information can be provided by your host. Choose from FTP, SFTP (with password), SFTP (with key), FTP with SSL/TLS, Amazon S3, GitHub Pages, Netlify, Google Cloud and GitLab Pages. There is also a Manual Upload option for users that wish to deploy their site manually.
Depending on the protocol that you wish to use, the available options will change as each option will have unique security, setup or sync requirements. You'll need to enter your selected protocol's configuration options and the click the Save button to store the details; if necessary you may also click the Test Connection button to make sure Publii is able to connect and sync with your server. Now let's look at each of the available protocols and their respective settings separately:
FTP (File Transfer Protocol) is used when using a server provided by a host; if you've bought a hosting plan from a host like GoDaddy or Bluehost then Publii will use FTP to move and manage all your website files to your server. There are three types of FTP supported by Publii; standard FTP, or the more secure SFTP and FTPS. Most hosts will support one of the more secure options, but if in doubt it's best to check with your host's customer service team to ensure you have the most secure connection possible.
The available options when selecting FTP as your protocol are:
- Port - Sets the port that Publii should connect through; this is usually set to the default '21', but your host provider can advise you of their required settings.
- Server - Put the URL for your FTP server access here; this will be a web address beginning with the prefix ftp:// rather than http://.
- Username - The username for your FTP access.
- Password - The password for your FTP access. Both of these are required so that Publii can access the server. Text entered here will be obscured for security purposes; to display the typed text, click the "Show Password" text in this field.
- Your Key (SFTP with key only) - Define the path to your SFTP key here; clicking on the field will open the file explorer; simply navigate to and select your key to continue.
- Key Passphrase (SFTP with key only) - Enter the passphrase for your SFTP key here if you have one.
- Always Ask For Password - When this option is enabled you will be required to enter the FTP password every time you sync your site, for added security.
- Remote Path - The remote path is the folder that your FTP opens to when first connecting; usually this would be the main /public_html/ folder, but it may be that you have limited access to a particular subfolder, such as public_html/mySite/.
Amazon S3 (Simple Storage Service) provides online storage for data files that can then be used for multiple purposes, including displaying the data as a static website. When Amazon S3 is set as your chosen protocol, the following options will be available (if you require a more in-depth tutorial, please check the next section of this guide which covers Setting up Amazon S3 Hosting):
- Access ID - Enter the Access ID created for your website hosting bucket here.
- Password - Enter the password for your bucket here.
- Bucket - Add your (case-sensitive) bucket name to this field.
- Region - Choose the same region you have set for your bucket from this drop-down list.
- Remove remote files - When this option is enabled, if Publii finds any files that are not already stored by Publii locally, then they will be deleted. If you are only using your bucket for a single site you should leave this enabled.
- Prefix - Enter a prefix here (e.g. blog/) to create a subdirectory in your bucket and upload the website files to it.
GitHub Pages are areas provided by GitHub for hosting a website, either for highlighting a project, or just yourself! When GitHub Pages is set as your protocol, the following options will be available (full details on setting up and configuring GitHub Pages for your Publii site may be found in the GitHub Pages section of this guide):
- Username - Enter your GitHub username here.
- Repository - Enter your repository name here.
- Branch - Add the name of the branch you've set as your GitHub Page location in your repository in this field.
- Token - Put your generated security token in this field.
Once the server options are set you can click the Save Settings button to store the data. If necessary you can click the Test Connection button to make sure Publii is able to connect and sync with your server.
Netlify is a storage and website hosting service much like GitHub and Amazon S3, with flexible payment options and a free starter level. If Netlify is set as your protocol in Publii, the following options will be available (full step-by-step instructions to setting-up Netlify for use with Publii may be found in the Netlify section of this guide):
- Site ID - Enter the Site ID from the Netlify Site Info screen here.
- Netlify Token - Enter the token generated on your Netlify account here.
Of all the online storage solutions, Google Cloud ranks alongside Amazon S3 as one of the biggest and most complex. Difficult to setup without experience, it nevertheless offers a huge amount of customization compared to its peers. If Google Cloud is set as your protocol in Publii then the following options will be available (an in-depth guide to setting up Publii with Google Cloud may be found in the Google Cloud section of this guide):
- Your JSON key - Enter the path to the JSON file containing your Google Cloud access key here.
- Bucket - Enter your Google Cloud bucket name here
Similarly to GitHub Pages, GitLab Pages are a hosting area for projects created on GitLab, which can be used to create a website for documentation or promotion of the project. If GitLab Pages is set as your protocol, the following options will be available (if you need help with setting-up your GitLab Pages to support your Publii site, a step-by-step guide may be found in the GitLab Pages article of this guide):
- Server - Points to the server where your GitLab Page is stored; this should be left as default unless you are running your own GitLab instance.
- Repository - Enter your project's name in this field (it must match the name as it was entered on the GitLab Pages site).
- Branch - Enter the name of the project branch that your website will be published to. If you are not sure, you can double-check which branch is used by your project on GitLab.
- Token - Enter the access token for your repository in this field.
Though Publii is designed to manage website updates and syncs automatically, there may be some users who do not have direct access to their server, prefer to upload their website manually, or just wish to output their site in a zip file for later deployment. In these cases, users can take advantage of the manual upload option, which outputs the website in a format of your choice.
The following options will be available if Manual Upload is set as your protocol:
- Output Type - Sets the file format that Publii should output your site as when a sync operation is run. Choose from a compressed ZIP or TAR file, or the uncompressed site folder. Output files are stored in the same location as your Publii website files location; once sync is complete you will be given the option of opening this location automatically.
- Output Directory - Sets where the output file should be placed when generated. Clicking on the empty field will open the file explorer for you to choose a location.