How to Deploy Your DesktopServer Website Using Direct Deploy to a Live Server
The Direct Deploy feature gets your WordPress websites from your desktop to your hosting provider in just a few clicks. No FTP or SSH client is necessary. In fact, you won’t even need such credentials to launch. What you will need is a hosting provider that supports WordPress’ File System Direct feature (fortunately, most shared and VPS hosts support this). This post will show you how to use the new feature to launch your site live or to setup a preview site on an existing domain for client previews. A quick summary of what we will cover follows:
- Install WordPress on your destination server.
- Activate the DesktopServer for WordPress plugin.
- Use DesktopServer’s “Direct deploy to an existing server” option.
- First, your host should naturally support WordPress.
- Also, your host must support File System Direct. File System Direct is a (PHP) feature that allows WordPress to write files to the local file system on the server. This is used primarily to update WordPress, install plugins, or install themes without having to provide FTP or SSH credentials. Files are written to the file system under the user account of the running web server. Some shared hosts do not support this because a misconfiguration or web server running as “root” (which would allow writing files anywhere) could put a server at risk. Thankfully, most shared hosts today have properly configured servers that have separate isolated accounts for providing web services. Most cPanel enabled hosts such as Hostgator or Bluehost support File System Direct and work well with DesktopServer’s direct deploy feature.
Some designers may wish to provide a preview of their website to a client before deploying to their main domain name. If you don’t want a subdomain, just skip to the next paragraph to install WordPress. You can make a preview site by creating a subdomain which is the preferred method of doing a preview website. This is because WordPress uses “fully qualified URLs” instead of what traditional HTML websites may use: “relative URLs”. The former being more secure but more difficult to change. It is far easier to have your development website mirror your live website and switching domain names is a lot easier. For this example, I’ll show you how to create a preview website on a hosting provider that supports subdomains so that we can make a http://testing.example.com without affecting the main http://www.example.com website. We’ll be using a cPanel powered hosting provider such as Hostgator or Bluehost which supports subdomains on all their hosting plans. Just go to your cPanel and look for the “Subdomains” icon. You can add a subdomain and give it a unique name, such as “testing” to end up with something like http://testing.my-domain.com. The subdomain will live in a separate folder that will house all of our website files.
2) Install WordPress on your hosting provider.
Thankfully, most hosts provide an automated wizard to install WordPress or at the very least, provide free support to get WordPress up and running. This will provide a ‘blank canvas’ and will also validate your host as capable of running WordPress. You can think of it as formatting a disk before use. It’s okay if you already have a WordPress site with content at your destination, but please note that this process is destructive. You will overwrite any existing data at your destination site. Be sure to make a backup if you want to preserve any existing data on your live site. If you look at your hosting provider’s control panel, they may feature an icon for Fantastico or QuickInstall. The later is preferred as QuickInstall provides the latest version of WordPress. Simply select WordPress on the left hand side followed by the domain or subdomain where you want to install WordPress. Be sure to write down your admin username and password (we will need this for step 3).
Login to the WordPress administration screen after installing WordPress on your live hosting provider’s server. We will need to install the DesktopServer for WordPress plugin that is freely available from the WordPress directory. From the administration menu, visit Plugins -> Add New, and type “DesktopServer” in the search form. Be sure to activate the DesktopServer for WordPress plugin after installation. The plugin will allow you to deploy your development website to the live server without having to go though an FTP or SSH client. This plugin will test to see if your hosting provider supports File System Direct and will automatically be removed after deployment. Click the screenshot to the left for a detailed view. If the WordPress installation on your live host is older than version 3.5 , you will need to turn on the XML-RPC via WordPress’ Settings -> Writing options page (see the section for “Remote Publishing”). XML-RPC is now a standard feature for all WordPress installations. See lower right side of WordPress’ dashboard to determine the WordPress version number.
You can use DesktopServer’s export feature to deploy your development site to your live host. Start DesktopServer and select the option to “Import, export or share a website”, followed by “Export or deploy a WordPress website”. Click next and you will be presented with a drop down combo box to select the development website you want to deploy. Be sure to type in the domain name (or preview subdomain name) you wish to deploy to (i.e. testing.postmy.info) in the “Export As” text box. Select the “Direct deploy to an existing server” option and you will be prompted for your WordPress admin credentials. These will be the credentials of your destination server’s WordPress installation (see screenshot).
The next screen will provide you with three options: 1) Encourage search engine visibility (which you will want to turn OFF if you are creating a preview site to prevent contaminating your SEO results or leave checked ON for your real site), 2) Purge post and page revisions (the default is on to make deployments faster), and 3) Customize scrubbing options. Click next and DesktopServer will prepare your development website for deployment by performing a number of important tasks, such as:
- Replacing your development site .dev domain name with the real top level domain name in both your files and database.
- Copy only your site data to a temporary folder, purging unnecessary files that might pose a security risk (Netbeans and Dreamweaver notes and project files).
- Remove any bulky hidden folders such as .git/.svn source code repositories (this is done on the copy, not your actual development folder).
- Compress files and split large files (such as video) for faster upload and processing on your hosting provider.