Creating Access Tokens for Pushing Packages to Gitea

Last modified by DevOps-as-a-Service Operator on 2025/02/05 11:33

This essential guide is designed to generate access tokens necessary for pushing packages to Gitea.

  1. Login to Gitea using your personal account, as described in Gitea. If you want to create a token for a Gitea Technical User instead, use an anonymous browser window and login to Gitea with the credentials of the Gitea Technical User.
     
  2. Navigate to the settings in the Gitea profile of the user in the top right corner of the screen:

    image-2024-2-9_9-44-52.png

     
  3. Find the "Applications" section and select "Generate New Token". Name the token and ensure you select the Read and Write options for package management.image-2024-2-9_9-34-14.png

     

  4. Upon generation, copy the token immediately, as it won't be displayed again. This token is essential for pushing NPM packages to Gitea:

    image-2024-2-9_9-37-34.png

     
Information

Following the least privilege principle, it's more secure to create another token which just has Read permission for all use cases where you just want to pull packages, but not allow pushing.