CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Follow publication

Member-only story

How to Create a FastAPI / Uvicorn Server Windows Service

Photo by Inês Pimentel on Unsplash

Recently, I found myself in a position where I wanted to create a Windows service that would be responsible for starting up a FastAPI server automatically on boot up. However, I couldn’t find any article or tutorial that covers it in a structured and detailed manner. Since I got it working so wanted to share it with the community so that if anyone else wants to do the same it would be easier.

Introduction

Let us look at what a Windows Service is briefly. In a broader context, a daemon is a computer program that runs in the background without being under the control of an active user. Windows services arewhat performs the functions of a daemon on Windows OS. [1] These allow the creation of long running executable applications that run in their own Windows sessions. [2] These services can be set up to automatically start when the system starts or boots up, can be paused and restarted and do not have any user interface. It is because of all these features that Windows services are ideal in cases where one requires long running functionality which does not interfere with user activities.

There is extensive documentation for how to create a Windows service in .NET from Microsoft. However, for python the opposite is true i.e. there is no documentation available for creating Windows services…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Manpreet Singh Minhas
Manpreet Singh Minhas

Written by Manpreet Singh Minhas

DL/CV Research Engineer | MASc UWaterloo | Follow and subscribe for DL/ML content | https://github.com/msminhas93 | https://www.linkedin.com/in/msminhas93

Responses (4)

Write a response