The server for hosting pub packages on pub.dev is implemented using AppEngine Custom Runtimes with Flexible environment (see package:appengine for more information about Dart support for AppEngine).
This code isn't designed with private hosting in mind. If you need a private hosted environment, you may find some of the suggestions in this page to be helpful.