Skip to content

Setting up i2pd as Windows Service

R4SAS edited this page Oct 9, 2022 · 9 revisions

Introduction

One can set up i2pd as a Windows Service. This way it will run in the background without any annoying windows or tray icons. It can be controlled with a standard Services snap-in of Microsoft Management Console (MMC).

For registering i2pd as Windows Service, you can use standard tool sc.

Service installation

Fire up elevated Command Prompt (Win+X, A since Windows 8) and type in the following making sure you use the correct path where you have i2pd.exe.

Note: Mind spaces after =!

sc create i2pdService binPath= "C:\Program Files\i2pd\i2pd.exe --daemon --service" DisplayName= "i2pd router service" obj= "NT AUTHORITY\LocalService" start= "auto"

The service will run under special LocalService user account. Its configuration folder is likely С:\ProgramData\i2pd. You will need elevated privileges to access LocalService AppData location. You may find it handy to use Far File Manager or alike for such manipulations.

But if you want to put i2pd.conf in the application directory, you must remove --service from the create service command above and it will start running in the same directory as i2pd.exe.

screenshot

Service removal

To uninstall this service use

sc delete i2pdService

from the eleveated Command Prompt. Make sure that MMC is closed, especially if you plan to reinstall it. Otherwise it will only be marked for deletion thus preventing subsequent creation.

Regular user account

You can also run i2pd service under your user account if you want to use exactly the same configuration. Keep in mind security implications if you chose so1.

Using Services snap-in of MMC, set your credentials for i2pd router service in its properties on Log On tab. Your user account must have a password that you'd have to keep updated in Services snap-in of MMC. It is, probably, possible to disable this via policies, but you should know what you are doing.

You can leave password field blank if you are changing account back to NT AUTHORITY\LocalService.


1Although it is no different than running i2pd as a regular desktop application.