Pre-requisites:
- Install Kopia. In this example, I have installed KopiaUI to
C:\Program Files\KopiaUI
. - Download Shawl from https://github.com/mtkennerly/shawl.
- Place shawl.exe in a suitable directory. In this example, shawl was placed to
C:\Program Files\Shawl\shawl.exe
. - Create a directory to store Kopia data files. In this example, we are using
C:\ProgramData\kopia
First, we will set up Kopia and check that it's working as a regular application:
-
Create a
htpasswd
file, with a user calledkopia
and a secure password. Place the file inC:\ProgramData\kopia\htpasswd
. Creating a htpasswd file on Windows is not very straightforward. If you have access to a Linux system, you can generate it there and copy it to your Windows machine$ htpasswd -c ./htpasswd kopia
-
Start Kopia for the first time, with a
--tls-generate-cert
parameter:C:\>kopia server start --tls-cert-file C:\ProgramData\kopia\kopia.cert --tls-key-file C:\ProgramData\kopia\kopia.key --htpasswd-file C:\ProgramData\kopia\htpasswd --address https://0.0.0.0:51515 --tls-generate-cert
This will generate a TLS certificate in
C:\ProgramData\kopia
.If you have Windows Firewall enabled, it should now pop up with a window asking you to allow network access for Kopia. This is needed for Kopia web-based UI to be accessible from other machines; if you don't need that, you can ignore the Firewall pop-up and close it.
-
Open your web browser, navigate to
https://localhost:51515
. The TLS certificate will be self-signed, so your browser will warn you about it not being secure. This is expected, you can safely ignore the warning and add an exception.You should be able to log in with the
kopia
user and the password you stored in thehtpasswd
file, and then see the Kopia UI in your browser. -
Stop Kopia by pressing Ctrl+C.
Next we will configure Shawl to run Kopia as a Windows service.
-
Start a command line as Administrator. You need to have Administrator rights to install and maintain Windows services.
-
Add Kopia as a Windows service using Shawl:
C:\>"C:\Program Files\Shawl\shawl.exe" add --cwd C:\ProgramData\kopia --log-dir C:\ProgramData\kopia\logs --name Kopia -- "C:\Program Files\KopiaUI\resources\server\kopia.exe" server start --tls-cert-file kopia.cert --tls-key-file kopia.key --htpasswd-file htpasswd --address https://0.0.0.0:51515
(add
--enable-actions
to the command line if you wish to enable actions) -
Configure the service to start automatically during boot, and then start it immediately.
C:\>sc config Kopia start=auto C:\>sc start Kopia
-
Check if the service is running:
C:\>sc query Kopia SERVICE_NAME: Kopia TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
-
Open your web browser, again navigate to
https://localhost:51515
. You should be able to log in to Kopia running as a Windows service. Now proceed to configure Kopia using the web UI as usual. -
(Optional) Reboot your computer and verify that Kopia starts automatically as a service.
(consider this text public domain)
@matushorvath I appreciate you taking to the time to respond and with such detail as well. After reading the above I have 2 follow-up questions:
Did you run/execute the repository connect server" command before running the above command to add the user? e.g
kopia repository connect server --url https://localhost:51515 --server-cert-fingerprint <cert-sha1-fingerprint>
Where did you read (in docs) or knew that you needed to include
--config-file
in the above command to add the user? One of the shortcomings of this project is the steep learning curve for newcomers which isn't helped by the lack of proper documentation and the somewhat convoluted design of the tool.