Installing Docker on Nano Server in windows 2016
In this blog, we will show you installing docker on nano server.
REQUIREMENTS
- A Nano server with static (or) dynamic IP.
NANO SERVER OVERVIEW
- We have already installed a nano server VM for this demonstration. We also set an IP as 192.168.232.81 and it’s in WORKGROUP.
ACCESSING NANO SERVER REMOTE SERVER
- As this nano server is not in a domain, we need to add the nano server IP in the trusted host on the remote server. To add the trusted hosts execute the below command.
Set-Item WSMan:\localhost\Client\TrustedHosts 192.168.232.81 -Force
- To access the nano server remotely, execute the below command.
Enter-PSSession -ComputerName 192.168.232.81 -Credential (get-credential)
Provide the login credentials and click OK.
- After successful login, the PowerShell prompt will look like below.
You can see the Nano server IP on left side of command prompt.
INSTALLING WINDOWS UPDATES ON NANO SERVER
POWERSHELL COMMANDS:
- To install the windows updates, execute the below commands.
$sess = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
Invoke-CimMethod -InputObject $sess -MethodName ApplyApplicableUpdates
The first command will create a session using New-Ciminstance cmdlet for MSFT_WUOperationsSession class. Then we are invoking a CIM method for MSFT_WUOperationsSession class for the method ApplyApplicableUpdates.
- Once the installation completes, it shows the return value as 0. It means, all the updates has been installed successfully.
- Restart the nano server to apply the changes using below command.
Restart-Computer
Then exit the session using exit command and re-connect the server using PSSession command.
INSTALLING NuGet PROVIDER
- Once you reconnect to the nano server, execute the below command to install NuGet provider for docker.
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
- Type Y and press enter to import the NuGet provider.
- It shows the PowerShell command prompt once the installation is complete.
INSTALLING DOCKER SERVICE
- From the PowerShell command prompt, execute the below command to install docker package.
Install-Package -Name docker -ProviderName DockerMsftProvider –verbose
- Type A and press enter to accept the non-trusted docker package.
- Installation is completed and we need to restart the nano server to apply the changes.
- Restart the nano server using the below command.
Restart-Computer
VERIFYING DOCKER SERVICE
- Reconnect the nano server and check the status of the docker service using below command.
Get-Service docker
- If service is in stopped state, use start-service docker to start the docker service.
- To check the docker version, execute the below command.
docker version
Video
Thanks for reading this blog. We hope this was useful for you to install docker in nano server.
Loges