I'm building a GitLab self-hosted instance for academical purpose, using GitLab CE, and I want to limit the space which stores each user.

I want to set a maximum size to store in a repository, which locks the uploads in case that user exceed the repository storage limit.

As this way, when this limit is get, the user only can remove files (or the content of these), but never upload new files or add new content

Are there any way to do this?

  • What have you tried so far? Have you done any research to see if this product supports that function? Jan 13, 2020 at 4:52
  • I tried to limit the repository stotage, but this function only exists in GitLab EE
    – AlmuHS
    Jan 13, 2020 at 9:34

2 Answers 2


Sorry to say, this is not available in the Core (CE) version as you've noted. Repository limit is only available with a paid license.

Though you can see how it was implemented.


Finally, I solved It using a pre-receive hook in server-side. The hook raise a bash script, which check the repository folder size using du -s and return 1 if this size exceeds the sizelimit


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.