# Fly deploy permission denied connecting to Docker daemon

**URL:** <https://community.fly.io/t/fly-deploy-permission-denied-connecting-to-docker-daemon/7402>\
**Category:** Questions / Help\
**Created:** [September 24, 2022, 4:13am UTC](https://community.fly.io/t/fly-deploy-permission-denied-connecting-to-docker-daemon/7402 "2022-09-24T04:13:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiao-meng1](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/xiao-meng1/32/5845_2.png) [@xiao-meng1](https://community.fly.io/u/xiao-meng1)\
**Post date:** [September 24, 2022, 4:13am UTC](https://community.fly.io/t/fly-deploy-permission-denied-connecting-to-docker-daemon/7402/1 "2022-09-24T04:13:17Z")

</div>

I was going through the “Hands on with [Fly.io](http://Fly.io)” tutorial with my own Docker image and am running into some errors with the fly deploy command.

```auto
fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Searching for image 'xmeng999/bug-tracker-api:latest' remotely...
Error failed to fetch an image or build from source: Authentication required to access image "docker.io/xmeng999/bug-tracker-api:latest"

```

```auto
fly deploy --local-only --verbose
==> Verifying app config
--> Verified app config
==> Building image
WARN Error connecting to local docker daemon: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
Error failed to fetch an image or build from source: no docker daemon available

```

fly.toml:

```auto
# fly.toml file generated for bug-tracker on 2022-09-23T21:10:35-06:00

app = "bug-tracker"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  image = "xmeng999/bug-tracker-api:latest"

[env]

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

```

Dockerfile:

```auto
FROM node:18

WORKDIR /app

COPY package*.json ./
COPY prisma ./prisma

RUN npm install

COPY . .

RUN npm i -g prisma
RUN prisma generate

ENV PORT=5000
EXPOSE 5000

CMD ["npm", "start"]

```

---

<div class="post-metadata">

**Author:** ![ignoramous](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@ignoramous](https://community.fly.io/u/ignoramous)\
**Post date:** [September 25, 2022, 5:13am UTC](https://community.fly.io/t/fly-deploy-permission-denied-connecting-to-docker-daemon/7402/2 "2022-09-25T05:13:47Z")

</div>

> [@xiao-meng1](#):
>
> `fly deploy`
> 
> ```auto
> Error failed to fetch an image or build from source:
> Authentication required to access image "docker.io/xmeng999/bug-tracker-api:latest"
> 
> ```

This doesn’t work since Fly’s remote builders don’t fetch images from private repositories: [Feature request: Images from private Docker registries - #2 by kurt](https://community.fly.io/t/feature-request-images-from-private-docker-registries/842/2)

You can choose to push your private docker images to Fly, however: [Session affinity ("sticky sessions")? - #9 by kurt](https://community.fly.io/t/session-affinity-sticky-sessions/638/9) | [Requesting recommendations for making Fly less flaky for CI - #2 by ignoramous](https://community.fly.io/t/requesting-recommendations-for-making-fly-less-flaky-for-ci/7129/2)

> [@xiao-meng1](#):
>
> `fly deploy --local-only --verbose`
> 
> ```auto
> Error failed to fetch an image or build from source:
> no docker daemon available
> 
> ```

I haven’t seen this before, but sounds like docker may be running with tighter permissions than usual: [jenkins - Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock - Stack Overflow](https://stackoverflow.com/questions/47854463)
