How to install and maintain WordPress on a hosted web server

Management of WordPress installations on our comprehensive web hosting service generally requires access using SSH. View our How to connect using SSH / SFTP guide for information on suitable clients.

Expand All

The following guide is a complete but basic installation covering common requirements. The official WordPress site includes full instructions for installing WordPress that cover optional and specialised requirements.

  1. Connect using SSH to access.nsms.ox.ac.uk and login with your site administrator credentials. Then change into the htdocs folder where your site installation should reside:
    $ cd <site-name>/htdocs/
    
  2. We recommend that you create a .htaccess file to restrict access to the site until it is ready to launch. The following example file will restrict access to Oxford networks only:
      Require ip 129.67.0.0/16
      Require ip 163.1.0.0/16
      Require ip 192.76.8.0/26
    
  3. Download and unpack the WordPress site framework:
    $ cd <site-name>/home/
    $ wget https://wordpress.org/latest.tar.gz
    $ tar xzvf latest.tar.gz --strip 1 -C ../htdocs/
    $ cd ../htdocs/
    $ mv wp-config-sample.php wp-config.php
    
  4. Add or amend the following entries in wp-config.php to configure access to your database:
    define('DB_NAME', 'database_name_here');
    define('DB_USER', 'database_username_here');
    define('DB_PASSWORD', 'database_password_here');
    define('DB_HOST', 'database_hostname_here');
    
  5. Generate the required security keys and append these to wp-config.php. The recommended way to generate the security keys is using the online security key generator
  6. Use a web browser to visit your site and perform initial configuration as follows:

    Select English (UK), continue;
    Enter a site name;
    Enter an admin username;
    Copy the password somewhere safe, or alter it, but keep in mind that by default this login page will be accessible to the whole of the internet, so passwords need to be strong;
    Enter your email address;
    Select  Discourage search engines (so that unfinished sites are not indexed - you can change this later);
    Select Install WordPress;
    Select Log In;
    Enter the admin credentials that you just created

  7. Create your content
  8. Once the site is ready to launch, alter the .htaccess file as per https://wordpress.org/support/article/htaccess/
  1. Make a file-based backup of your site database
  2. Take a copy of your site files, including the site database backup, to a separate system using SFTP

Further details on both steps are available in How to manage sites on our comprehensive web hosting service.

  1. Take a backup of your WordPress site (see earlier guidance)
  2. Check that you are not close to your storage limit
  3. Use the built-in WordPress one-click update. If this works then your upgrade is complete. If it fails then follow the remaining steps to upgrade manually
  4. Disable all plugins, connect to access.nsms.ox.ac.uk and run the following commands:
    $ cd <site-name>/home/
    $ wget -O latest.tar.gz https://wordpress.org/latest.tar.gz
    $ cd ../htdocs/
    $ rm -rf wp-includes/
    $ rm -rf wp-admin/
    $ tar -xzvf ../home/latest.tar.gz wordpress/wp-includes --strip 1
    $ tar -xzvf ../home/latest.tar.gz wordpress/wp-admin --strip 1
    $ tar -xzvf ../home/latest.tar.gz wordpress/wp-content --strip 1
    $ tar -xzvf ../home/latest.tar.gz --strip 1 --no-recursion --wildcards --no-wildcards-match-slash wordpress/"*"
    
  5. Use a web browser to visit the administration URL for your site (<site-name>/wp-admin/). Click Update WordPress Database
  6. Update all your plugins, and re-enable them. If a plugin or other code cannot be updated or is no longer supported, then consider whether it is safe to use

For full instructions see the official guidance on updating WordPress and the extended guidance on updating WordPress.

Get support


If you cannot find the solution you need here then we have other ways to get IT support

Get IT support

 

Submit a suggestion, compliment or complaint