PASTERD(8) - System Manager’s Manual


pasterd - simple paste service


pasterd [-fqv] [-d database-path] [-t theme-directory]


The pasterd utility is a simple CGI or FastCGI program to host code snippets over a web interface. It will show most recent public pastes and let users to create new one from a web form.

It supports:

To store pastes, pasterd uses a SQLite database that must be writable by the CGI/FastCGI owner. See usage below.

Available options:


Starts as FastCGI mode, pasterd will wait forever for new requests.

-d database-path

Specify an alternate path for the database.

-t theme-directory

Specify an alternate directory for the theme.


Do not log through syslog at all.


Increase verbosity level.


The pasterd utility does not use configuration file as it does not need many adjustments, instead every parameter could be passed by environment variables or options.

By default, pasterd will try to use /usr/local/var/paster/paster.db database.


The pasterd utility will log information through syslog unless verbosity is disabled. Except at startup where the tool can write to stderr some information if it can’t continue processing, the tool will never write anything to stdout and use syslog only.

The available verbosity level is defined in the following order:

none < warnings (default) < info < debug

Use -q or PASTERD_VERBOSITY=0 if you want to disable syslog completely.


The recommended way to use pasterd is to deploy using FastCGI. You can use the kfcgi(8) helper to spawn the process for you.


kfcgi -p /var/www/paster -- pasterd -f -d paster.db -t siimple

Note: kfcgi chroot to the directory given, you must either statically link pasterd at build time or deploy all required libraries. Also, themes directory will need to be available in the chroot directory. In the above example, this will effectively create a database /var/www/paster/paster.db and use the theme /var/www/paster/siimple.

Then, simply copy the desired theme into the directory.

cp -R /usr/local/share/paster/themes/siimple /var/www/paster

As an insecure alternative, you can chroot to / to avoid static-linking and copying themes, using:

kfcgi -p / -- pasterd -f \
    -d /var/www/paster/paster.db \
    -t /usr/local/share/paster/themes/siimple

Both kfcgi invocations will create /var/www/run/http.sock with current user and group. Configure the web server to talk to that socket and make sure it has appropriate file permissions otherwise see -u option in kfcgi. See also the kfcgi(8) manual for more information.

Next, configure the web server.

Warning: at this moment, pasterd requires its own virtual host and can not use a url.

Server: nginx

The nginx web server requires several parameters to run pasterd.

server {
    listen 80;

    location / {
        fastcgi_param QUERY_STRING      query_string;
        fastcgi_param REQUEST_METHOD    $request_method;
        fastcgi_param CONTENT_TYPE      $content_type;
        fastcgi_param CONTENT_LENGTH    $content_length;
        fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME       $fastcgi_script_name;
        fastcgi_param PATH_INFO         $document_uri;
        fastcgi_param PATH_TRANSLATED   $document_root$fastcgi_path_info;
        fastcgi_param REQUEST_URI       $request_uri;
        fastcgi_param DOCUMENT_URI      $document_uri;
        fastcgi_param DOCUMENT_ROOT     $document_root;
        fastcgi_param SERVER_PROTOCOL   $server_protocol;
        fastcgi_param GATEWAY_INTERFACE CGI/1.1;
        fastcgi_param SERVER_SOFTWARE   nginx/$nginx_version;
        fastcgi_param REMOTE_ADDR       $remote_addr;
        fastcgi_param REMOTE_PORT       $remote_port;
        fastcgi_param SERVER_ADDR       $server_addr;
        fastcgi_param SERVER_PORT       $server_port;
        fastcgi_param SERVER_NAME       $server_name;
        fastcgi_param HTTPS             $https;
        fastcgi_pass unix:/var/www/run/httpd.sock;


The following environment variables are detected:


Path to the SQLite database.


Directory containing the theme.


Verbosity level, 0 to disable completely.


pasterd was written by David Demelier <>


paster(8), kfcgi(8)

macOS 11.2 - 06 February, 2020