Lisp support was discontinued in March 2025. If you really want to power a Lisp project, feel free to contact us on our Discord.
Write your Lisp program
For this guide we will be using a basic example of a Hunchentoot-based web app (you can find the corresponding.asd and .yaml files further down):
PORT from the environment and sleeps at the end as (start acceptor) yields and the apps run in the foreground as required.
This code is surprisingly legible. For example, use means “import all the symbols so there’s no need to prefix them with the package name” and cl-who allows the actual HTML to be created.
Specify the language in your app
Next, make sure that you specifylisp as your app’s type in your config.yaml:
- Platform.sh
- Upsun
Handle dependencies
The recommended way to handle Lisp dependencies with Upsun and Platform.sh is through using ASDF. ASDF is a description of dependencies between files of source code in such a way that they can be compiled and loaded in the right order. Create an.asd file. When an .asd file is found in your repository, the system will automatically download the dependencies using QuickLisp.
Below is an example.asd file:
Assumptions
Before we continue, the following assumptions have been made about your application to provide a more streamlined experience. These assumptions are the following:- Your
.asdfile is named like your system name. For example, our application above is namedexample.asdand has(defsystem example ...)in the.asdfile.
(asdf:make :example) will run on our system to build a binary.
If you don’t want these assumptions, you can disable this behavior by specifying in your config.yaml:
- Platform.sh
- Upsun
Specify QuickLisp distrubutions
If you wish to change the distributions that QuickLisp is using, you can specify those as follows, specifying a distribution name, its URL and, an optional version:- Platform.sh
- Upsun
- Platform.sh
- Upsun
Get built-in variables
Upsun and Platform.sh expose relationships and other configurations as environment variables. To get thePORT environment variable (the port on which your web application is supposed to listen):
Build and run your application
Assumingexample.lisp and example.asd are present in your repository, the app is automatically built on push.
You can then start it from the web.commands.start directive.
Note that the start command must run in the foreground. Should the program terminate for any reason it’s automatically restarted. In the example below the app sleeps for a very long time. You could also choose to join the thread of your web server, or use other methods to make sure the program doesn’t terminate.
Create a .yaml containing something like what is shown below:
- Platform.sh
- Upsun
Access services
The services configuration is available in the environment variablePLATFORM_RELATIONSHIPS.
To parse them, add the dependencies to your .asd file:
.yaml config file:
- Platform.sh
- Upsun
Depending on your needs, instead of the default endpoint configuration above, you can use an explicit endpoint configuration.
.asd file:
Conclusion
In conclusion, deploying a Lisp-based web application on Platform.sh and Upsun is a straightforward process once you understand the key configurations and dependencies involved. From setting up your Lisp program to managing environment variables and service relationships, you can easily get your application up(sun) and running.Once again, while Lisp’s support is discontinued as of March 2025, the language remains a valuable tool for certain projects. If you’re looking to power a Lisp application with
composable image in the future, don’t hesitate to reach out via our Discord for assistance.