Octopus Deploy Documentation

Starting, stopping, and restarting Windows services

Last updated

When developing a Windows Service, starting, stopping, and restarting are all common activities. However, once deployed to a server, the ability to start, stop, or restart a service requires the user to have either elevated permissions or at least be granted the ability to remotely perform the operation. If it's not possible (or feasible) to grant that permission, you may need to fill out a ticket and wait for a server administrator to do it for you, which can kill productivity. Using a runbook, you can give developers a self-service option to starting, stopping, or restaring a Windows service without having to give them access to the server or performing permissions wizardry.

For Windows Services, there are three Community Step Templates available, one for each action:

Create the Runbook

  1. To create a runbook, navigate to Project ➜ Operations ➜ Runbooks ➜ Add Runbook.
  2. Give the Runbook a name and click SAVE.
  4. Add one of the templates listed above.
  5. Fill out all the parameters in the step. It's best practice to use variables rather than entering the values directly in the step parameters.

All three services use a single parameter of the same name

Parameter Description Example
Service Name Name of the Windows Service MyService

With a relatively simple runbook you can empower developers and speed up time to market.


We have a Target - Windows Space on our Samples instance of Octopus. You can sign in as Guest to take a look at this example and more runbooks in the OctoFX project.

Need support? We're here to help.