<p>Docker can be set to run as a service, that should bypass the need to log in with a service account:</p>
<ol>
<li><code>dockerd.exe --register-service</code></li>
<li><code>net start Docker</code></li>
<li><code>sc config Docker start=auto</code></li>
</ol>
<p><a href="https://github.com/moby/moby/issues/27696" rel="nofollow noreferrer">Dockerd.exe</a></p>

CC BY-SA 4.0
2021-08-10T01:38:06.437Z
2021-08-10T01:38:06.437Z
Josh Zhang
<p>Is it possible to run Docker containers without being logged in as a user on Windows?  I have a few containers I am auto-deploying on a server, but I am currently stuck leaving a generic service account logged in so that the containers run and the docker daemon stays running.</p>

<p>My current setup works, but I feel like there must be a better way to deploy/run than to always have an account logged in.</p>

<p><strong>Setup</strong></p>

<ul>
<li>Windows Server 2012 and 2016</li>
<li>No docker-desktop because of nested virtualization scenario requirement</li>
<li>Linux not an option due to business requirements</li>
</ul>

CC BY-SA 4.0
2019-12-25T12:00:17.023Z
Did you create a Windows Scheduled task? In that service it is possible to click one 'user should not be logged on'. Does that work and would it be an option?
030
CC BY-SA 4.0
2019-12-26T12:53:41.520Z
@030 The Windows Scheduled task still needed a user to login.  The only way I've managed to get this to work is using Docker Windows, not the toolbox.  The only thing I've found is a third party tool: https://www.coretechnologies.com/products/AlwaysUp/Apps/StartDockerDaemonAsAWindowsService.html
Wesley Rolnick
CC BY-SA 4.0
2019-12-26T12:56:10.980Z
Could you post an answer?
030
CC BY-SA 4.0
2019-12-26T13:33:15.483Z
@030: I haven't found a non-commercial solution yet.
Wesley Rolnick
<docker><windows>
Run Docker Containers without having a logged in User on Windows
Wesley Rolnick
# Run Docker Containers without having a logged in User on Windows

(Asked by: username_0 on 2019-07-17)

Is it possible to run Docker containers without being logged in as a user on Windows? I have a few containers I am auto-deploying on a server, but I am currently stuck leaving a generic service account logged in so that the containers run and the docker daemon stays running.

My current setup works, but I feel like there must be a better way to deploy/run than to always have an account logged in.

**Setup**

* Windows Server 2012 and 2016
* No docker-desktop because of nested virtualization scenario requirement
* Linux not an option due to business requirements

**Tags:** docker, windows

> **Comments:**
> **username_1**: Did you create a Windows Scheduled task? In that service it is possible to click one 'user should not be logged on'. Does that work and would it be an option?  
> **username_0**: @username_1 The Windows Scheduled task still needed a user to login.  The only way I've managed to get this to work is using Docker Windows, not the toolbox.  The only thing I've found is a third party tool: https://www.coretechnologies.com/products/AlwaysUp/Apps/StartDockerDaemonAsAWindowsService.html  
> **username_1**: Could you post an answer?  
> **username_0**: @username_1: I haven't found a non-commercial solution yet.  

---

## 1 answers

### Answer by username_2 on 2021-08-10. Score: 1

Docker can be set to run as a service, that should bypass the need to log in with a service account:

1. `dockerd.exe --register-service`
2. `net start Docker`
3. `sc config Docker start=auto`

[Dockerd.exe](https://github.com/moby/moby/issues/27696)


---

