pub package
Null Safety
GitHub Tag
New Commits
Last Commits
Pull Requests
Code size

This is a simple HTTP file server integrated with Let’s Encrypt, gzip and CORS.


Since Dart can run in many native platforms (Linux/x64, macOS/x64/arm64, Windows/x86),
it can be an awesome way to have a HTTP Server running in any place,
including all the basic features needed today.

API Documentation

See the API Documentation for a full list of functions, classes and extension.


import 'dart:io';

import 'package:petit_httpd/petit_httpd.dart';

void main() async {
  var petitHTTPD = PetitHTTPD(Directory('/var/www'),
      port: 8080,
      securePort: 443,
      bindingAddress: '',
      letsEncryptDirectory: Directory('/etc/letsencrypt/live'),
      domains: {'': '[email protected]'});

  var ok = await petitHTTPD.start();

  if (!ok) {
    print('** ERROR Starting: $petitHTTPD');

  print('-- STARTED: $petitHTTPD');

CLI Tools


The petit_httpd is a CLI for the PetitHTTPD class.

First activate the petit_httpd command:

$> dart pub global activate petit_httpd

To run an HTTP Daemon:

$> petit_httpd ./www --port 8080 --securePort 443 --address --letsencrypt-path /etc/letsencrypt/live --domain

A BASH script will all together:


dart pub global activate petit_httpd

export PATH="$PATH":"$HOME/.pub-cache/bin"

mkdir -p /var/log/petit_httpd

petit_httpd /var/www --address --letsencrypt-path /etc/letsencrypt/live --domain -verbose  >> /var/log/petit_httpd/requests.log


The official source code is hosted @ GitHub:

Features and bugs

Please file feature requests and bugs at the issue tracker.


Any help from the open-source community is always welcome and needed:

  • Found an issue?
    • Please fill a bug report with details.
  • Wish a feature?
    • Open a feature request with use cases.
  • Are you using and liking the project?
    • Promote the project: create an article, do a post or make a donation.
  • Are you a developer?
    • Fix a bug and send a pull request.
    • Implement a new feature, like other training algorithms and activation functions.
    • Improve the Unit Tests.
  • Have you already helped in any way?
    • Many thanks from me, the contributors and everybody that uses this project!

If you donate 1 hour of your time, you can contribute a lot,
because others will do the same, just be part and start with your 1 hour.


Graciliano M. Passos: gmpassos@GitHub.


Apache License – Version 2.0


View Github