permission denied when trying to create app

I am following the tutorial which uses digitalocean server to deploy a simple app. So I created an account here for this process, generated the token, installed cli and running these commands:

$ doctl auth init
Using token for context default

Validating token... ✔


doctl apps create --spec spec.yml

and here is the spec.yml file:

name: demo
region: fra
  - name: demo
    dockerfile_path: Dockerfile
    source_dir: .
      deploy_on_push: true
      repo: myname/demo
      http_path: /my-working-endpoint
    http_port: 8080
    instance_count: 1
    instance_size_slug: basic-xxs
      - path: /

so here is what I see"

Error: opening app spec: open spec.yml: permission denied

what does it mean? Permission for what? The file itself, or it cannot connect to github or digitalocean. It is not clear what is wrong here

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
April 10, 2024

Hi there,

The error message you’ve shared suggests that the doctl command doesn’t have the necessary permissions to read the spec.yml file on your local machine.

This is not an issue with connecting to GitHub or DigitalOcean; rather, it’s about file access permissions on your system.

To verify if this is indeed the case, check the permissions of the spec.yml file to see if your user has read access to it.

ls -l spec.yml

The output will show the permissions on the left side.

If the permissions are restrictive (e.g., -rw-------), you might need to change them to allow your user to read the file. You can grant read permission to the file with the following command:

chmod +r spec.yml

Besides that, the error can also occur if the spec.yaml file is not in your current directory. If you’re in a different directory, doctl won’t be able to find and access the file. Use the pwd and ls commands to confirm your current directory and the files within it.

If the issue persists, try using the absolute path to the spec.yml file when running the doctl command. For example:

doctl apps create --spec /path/to/spec.yml

Replace /path/to/spec.yml with the actual path to your file.

Let me know how it goes!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel