# Setup Basic Auth Loki

**URL:** <https://community.grafana.com/t/setup-basic-auth-loki/121739>\
**Category:** Grafana\
**Tags:** auth, loki\
**Created:** [May 15, 2024, 9:02am UTC](https://community.grafana.com/t/setup-basic-auth-loki/121739 "2024-05-15T09:02:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwan2323](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/iwan2323/32/26860_2.png) [@iwan2323](https://community.grafana.com/u/iwan2323)\
**Post date:** [May 15, 2024, 9:02am UTC](https://community.grafana.com/t/setup-basic-auth-loki/121739/1 "2024-05-15T09:02:32Z")

</div>

Hi There,

I have installed loki in my client to monitoring logs.  
how to config for enable basic auth?

This is my config

```auto
auth_enabled: true

server:
  http_listen_port: 3100
  grpc_listen_port: 9096
  auth_config:
    basic_auth:
      enabled: true
      users_file: /etc/loki/.htpasswd

common:
  path_prefix: /etc/loki
  storage:
    filesystem:
      chunks_directory: /etc/loki/chunks
      rules_directory: /etc/loki/rules
  replication_factor: 1
  ring:
    instance_addr: 0.0.0.0
    kvstore:
      store: inmemory

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

ruler:
  alertmanager_url: http://localhost:9093

```

---

<div class="post-metadata">

**Author:** ![rgg1993](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rgg1993](https://community.grafana.com/u/rgg1993)\
**Post date:** [May 29, 2024, 10:23pm UTC](https://community.grafana.com/t/setup-basic-auth-loki/121739/2 "2024-05-29T22:23:33Z")

</div>

@iwan2323 please, check the doc: [Authentication | Grafana Loki documentation](https://grafana.com/docs/loki/latest/operations/authentication/)

as far as i know, currently there is no way to configure basic auth natively in Loki. However, you could configure an nginx with basic auth in front on loki so as to force at least some kind of authentication.
