How to Install WordPress on Windows Server 2016
Please share with your friends...
  • 1
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    4
    Shares


⇐ BackPageNext ⇒
WordPress

WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL featuring a plugin architecture and a template system. WordPress was used by more than 53% of all websites as of January 2018, and is reported as the most popular website management or blogging system in use on the entire Internet.

Installation

The following instructions are used to install WordPress on Windows Server 2016 using PowerShell.

  1. Change into the Downloads directory, using the following PowerShell command:
    cd ~\Downloads
  2. Set temporary variables to be used during the WordPress installation, using the following PowerShell commands:
    $IIS_PATH = "$env:SystemDrive\inetpub"
    $WORDPRESS_PATH = "$IIS_PATH\wordpress"
    $WORDPRESS_URL = "https://wordpress.org/latest.zip"
    $WORDPRESS_ZIP = "wordpress.zip"
  3. Download and install WordPress, using the following PowerShell commands:
    Invoke-WebRequest "$WORDPRESS_URL" -OutFile "$WORDPRESS_ZIP"
    Expand-Archive "$WORDPRESS_ZIP" "$IIS_PATH"
  4. Grant the IIS_IUSRS and IUSR accounts Modify rights to the WordPress directory, using the following PowerShell commands:
    Add-NTFSAccess $WORDPRESS_PATH IIS_IUSRS Modify
    Add-NTFSAccess $WORDPRESS_PATH IUSR Modify
  5. Create a new Internet Information Services application pool for WordPress, using the following PowerShell commands:
    $WebAppPool = New-WebAppPool "WordPress"
    $WebAppPool.managedPipelineMode = "Classic"
    $WebAppPool.managedRuntimeVersion = ""
    $WebAppPool | Set-Item
  6. Create a new Internet Information Services website for WordPress, using the following PowerShell command:
    New-Website "WordPress" -ApplicationPool "WordPress" -PhysicalPath "$WORDPRESS_PATH"
  7. Remove the “Default Web Site” and start the new “WordPress” website.
    Remove-Website "Default Web Site"
    Start-Website "WordPress"

WordPress is now installed on Windows Server 2016 and ready to be configured.

Configuration

Now that WordPress is installed, it must be configured by completing a few simple steps. These actions must be performed from a workstation using a web browser.

  1. Use a web browser to connect to your new WordPress site, using either the Hostname or IP Address. The Language page will be displayed.
    WordPress Setup: Language
    Language
  2. Select your preferred Language and click Continue. The Let’s go page will be displayed.
    WordPress Setup: Let’s go!
    Let’s go!
  3. Click Let’s go! The Database Connection Details page will be displayed.
    WordPress Setup: Database Connection Details
    Database Connection Details
    From the Database Connection Details page, complete the details as shown in the following table:
    FieldValue
    Database Namewordpress
    Usernamewordpress
    Password********
    Database Hostlocalhost
    Table Prefixwp_
    The “wordpressuser and password were configured during MySQL database installation.
  4. Click Submit. The Run the install page will be displayed.
    WordPress Setup: Run the install
    Run the install
  5. Click Run the install. The Welcome page will be displayed.
    WordPress Setup: Welcome
    Welcome
    From the Welcome page, complete the details as described in the following table:
    FieldDescription
    Site TitleThis is the name of your WordPress site.
    UsernameThe username for your site Administrator account.
    PasswordThe password for your site Administrator account.
    Confirm PasswordIf you choose to use a weak password, this field will be displayed to ask your confirmation for the use of the weak password.
    Your EmailThe email address for your site Administrator account.
    Search Engine VisibilityWhether search engines should be discouraged from indexing this WordPress site.
  6. Click Install WordPress.The Success! page will be displayed.
    WordPress Setup: Success
    Success!
  7. Click Log In. The Log In page will be displayed.
    WordPress: Logon
    Log In
  8. Enter your log in credentials, and then click Log In. The WordPress Dashboard page will be displayed.
    WordPress Dashboard
    Dashboard
    WordPress is now configured on Windows Server 2016 and ready to be customised.
⇐ BackPageNext ⇒

How to Install WordPress on Windows Server 2016

Please share with your friends...
  • 1
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    4
    Shares
Tagged on:                                                 

9 thoughts on “How to Install WordPress on Windows Server 2016

  • 09/03/2018 at 8:58 AM
    Permalink

    Thanks for posting this! I’ve not run the entire script yet, but have a question about what is best to do when an install file is no longer available (or has been moved to an “archive” folder). I think I recall that the original posting was about May 2017. Some of the versions listed in the script are not available, or not where they were originally. Thoughts?

    Reply
    • 10/03/2018 at 2:54 PM
      Permalink

      Hi there!
      I’ve updated the instructions and script to download the latest versions of MySQL (5.7.21) and PHP (7.1.15), plus address an issue with HTTPS downloading in PowerShell. Tested on fully patched versions of Windows Server 2016 (v1607 b14393) and Windows 10 (v1709 b16299) – all good. Also removed PHP 5.5 from the instructions, as this is well out of support now.
      Hope this helps 🙂
      Chris

  • 21/03/2018 at 3:00 AM
    Permalink

    Hello,

    Thanks for posting this great tutorial. I’ve run into an issue midway through and can’t continue. Any suggestions?

    PS C:\Users\webadmin\Downloads> Set-Content $MYSQL_INIT “ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘H*****’;”

    PS C:\Users\webadmin\Downloads> Content $MYSQL_INIT “CREATE DATABASE wordpress;”
    >> Add-Content $MYSQL_INIT “CREATE USER ‘wordpress’@’localhost’ IDENTIFIED BY ‘H******’;”
    >> Add-Content $MYSQL_INIT “GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpress’@’localhost’;”

    Get-Content : A positional parameter cannot be found that accepts argument ‘CREATE DATABASE wordpress;’.
    At line:1 char:1
    + Content $MYSQL_INIT “CREATE DATABASE wordpress;”
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

    Reply
  • 14/06/2018 at 12:57 AM
    Permalink

    Is there a script to start from scratch?
    I had some issues and would like to reinstall ist, but how I do it?

    Reply
  • 28/06/2018 at 5:56 AM
    Permalink

    I was having a problem with Windows recognizing the “Install-WindowsFeature” command. I finally saw where someone had said not to use PS x86 for running a different script, so I switched to PS ISE and most of the commands ran without a problem. Or at least what wasn’t being downloaded was not due to running the wrong instance of PowerShell.

    Reply
  • 09/08/2018 at 12:01 PM
    Permalink

    The following is action #3 on Page2, but is missing from the PowerShell Script that has all the commands:

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

    If you don’t include it, there are file downloads that will fail (and the cause might not be obvious). I actually found this command elsewhere, and added it, which made the file downloads work. I happened to start rehearsing the process and saw it was mentioned in 3. I then checked the entire script and I don’t think it is there. If so, I missed it.

    Reply
  • 09/08/2018 at 12:07 PM
    Permalink

    The install went fine and I have a working WP site. But, I wanted a multisite site, so I went through that process, wanting sub sites that are subdirectories. The main site works fine, but the subsite does not show the site theme, nor can you get to the subsite’s Dashboard. I haven’t tracked down the answer yet, but I am thinking it may be something to do with the “rewrites”.

    Reply
  • 07/11/2018 at 3:46 AM
    Permalink

    Great walkthrough. I have been installing an internal WordPress Intranet server/site and it took me a while to get wordpress and HTTPS working with a self-signed cert. I eventually found instructions regarding exporting the server CERT in Base 64 encoded X.509 format and then adding this certificate information to the end of the \wp-includes\certificates\ca-bundle.crt file. This along with downloading the latest bundle of root certs from https://curl.haxx.se/docs/caextract.html helped fix the problem.

    I also found that I had to use the following command to configure IIS – “dism.exe /online /enable-feature /all /featurename:NetFX3 /Source:G:\sources\sxs
    Install-WindowsFeature Web-Server,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-CGI,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Security,Web-Filtering,Web-Performance,Web-Stat-Compression,Web-Mgmt-Tools,Web-Mgmt-Service,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Net-Framework-Core -IncludeManagementTools”.

    This required including the source option and pointing to the windows DVD/CD drive and also installing NETFX3 as this seemed to be missing from my 2016 server build.

    I hope this might be of use to someone else as there aren’t many sites/articles concerning setting up worpress on IIS.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *