How-To: Run Dapr in self-hosted mode without Docker
This article provides guidance on running Dapr in self-hosted mode without Docker.
Initialize Dapr without containers
The Dapr CLI provides an option to initialize Dapr using slim init, without the default creation of a development environment which has a dependency on Docker. To initialize Dapr with slim init, after installing the Dapr CLI use the following command:
dapr init --slim
In this mode two different binaries are installed
placement binary is needed to enable actors in a Dapr self-hosted installation.
In this mode no default components such as Redis are installed for state management or pub/sub. This means, that aside from Service Invocation, no other building block functionality is available on install out of the box. Users are free to setup their own environment and custom components. Furthermore, actor based service invocation is possible if a state store is configured as explained in the following sections.
See this sample for an example on how to perform service invocation in this mode.
Enabling state management or pub/sub
See configuring Redis in self hosted mode without docker to enable a local state store or pub/sub broker for messaging.
The placement service must be run locally to enable actor placement. Also a transactional state store must be enabled for actors.
By default for Linux/MacOS the
placement binary is installed in
/$HOME/.dapr/bin or for Windows at
$ $HOME/.dapr/bin/placement INFO starting Dapr Placement Service -- version 0.8.0 -- commit 74db927 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0 INFO log level set to: info instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0 INFO metrics server started on :9090/ instance=host.localhost.name scope=dapr.metrics type=log ver=0.8.0 INFO placement Service started on port 50005 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0 INFO Healthz server is listening on :8080 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
Update the state store configuration files to have the Redis host and password match the setup that you have. Additionally to enable it as a actor state store have the metadata piece added similar to the sample Java Redis component definition.
- name: actorStateStore value: "true"
The logs of the placement service are updated whenever a host that uses actors is added or removed similar to the following output:
INFO host added: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0 INFO host removed: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
Follow the uninstall instructions to remove the binaries.