LibreOffice Lambda Base Image
April 12, 2026 ยท View on GitHub
LibreOffice 26.2 base image for Lambda Node.js 20/22/24 x86_64 and Python 3.12/3.13/3.14 x86_64 to be used as a base for your own images.
Usage
Includes CJK fonts support! 877 MB in size.
Set environment variable
HOME=/tmpin your Lambda function.
Node.js 24 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-node24-x86_64
COPY handler.js ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.js:
const {execSync} = require('child_process');
const {writeFileSync} = require('fs');
module.exports.handler = () => {
writeFileSync('/tmp/hello.txt', Buffer.from('Hello World!'));
execSync(`
cd /tmp
libreoffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp ./hello.txt
`);
};
Node.js 22 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-node22-x86_64
COPY handler.js ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.js:
const {execSync} = require('child_process');
const {writeFileSync} = require('fs');
module.exports.handler = () => {
writeFileSync('/tmp/hello.txt', Buffer.from('Hello World!'));
execSync(`
cd /tmp
libreoffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp ./hello.txt
`);
};
Node.js 20 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-node20-x86_64
COPY handler.js ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.js:
const {execSync} = require('child_process');
const {writeFileSync} = require('fs');
module.exports.handler = () => {
writeFileSync('/tmp/hello.txt', Buffer.from('Hello World!'));
execSync(`
cd /tmp
libreoffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp ./hello.txt
`);
};
Python 3.14 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-python3.14-x86_64
COPY handler.py ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.py:
import subprocess
def handler(event, context):
with open('/tmp/hello.txt', 'w') as f:
f.write('Hello World!')
subprocess.run([
'libreoffice',
'--headless',
'--invisible',
'--nodefault',
'--view',
'--nolockcheck',
'--nologo',
'--norestore',
'--convert-to',
'pdf',
'--outdir',
'/tmp',
'/tmp/hello.txt'
], check=True)
Python 3.13 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-python3.13-x86_64
COPY handler.py ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.py:
import subprocess
def handler(event, context):
with open('/tmp/hello.txt', 'w') as f:
f.write('Hello World!')
subprocess.run([
'libreoffice',
'--headless',
'--invisible',
'--nodefault',
'--view',
'--nolockcheck',
'--nologo',
'--norestore',
'--convert-to',
'pdf',
'--outdir',
'/tmp',
'/tmp/hello.txt'
], check=True)
Python 3.12 x86_64
FROM public.ecr.aws/shelf/lambda-libreoffice-base:26.2-python3.12-x86_64
COPY handler.py ${LAMBDA_TASK_ROOT}/
CMD [ "handler.handler" ]
And your handler.py:
import subprocess
def handler(event, context):
with open('/tmp/hello.txt', 'w') as f:
f.write('Hello World!')
subprocess.run([
'libreoffice',
'--headless',
'--invisible',
'--nodefault',
'--view',
'--nolockcheck',
'--nologo',
'--norestore',
'--convert-to',
'pdf',
'--outdir',
'/tmp',
'/tmp/hello.txt'
], check=True)
Troubleshooting
Command failed: Fatal Error: The application cannot be started. User installation could not be completed.
Set environment variable HOME=/tmp in your Lambda function.
Available Tags & Versions
Current Versions (LibreOffice 26.2)
26.2-node24-x86_64- Node.js 24 with LibreOffice 26.2.226.2-node22-x86_64- Node.js 22 with LibreOffice 26.2.226.2-node20-x86_64- Node.js 20 with LibreOffice 26.2.226.2-python3.14-x86_64- Python 3.14 with LibreOffice 26.2.226.2-python3.13-x86_64- Python 3.13 with LibreOffice 26.2.226.2-python3.12-x86_64- Python 3.12 with LibreOffice 26.2.2
Previous Versions (LibreOffice 25.8)
25.8-node24-x86_64- Node.js 24 with LibreOffice 25.8.425.8-node22-x86_64- Node.js 22 with LibreOffice 25.8.425.8-node20-x86_64- Node.js 20 with LibreOffice 25.8.425.8-python3.14-x86_64- Python 3.14 with LibreOffice 25.8.425.8-python3.13-x86_64- Python 3.13 with LibreOffice 25.8.425.8-python3.12-x86_64- Python 3.12 with LibreOffice 25.8.4
Legacy Versions (LibreOffice 7.6)
7.6-node20-x86_64- Node.js 20 with LibreOffice 7.67.6-python3.12-x86_64- Python 3.12 with LibreOffice 7.67.6-node18-x86_64- Node.js 18 with LibreOffice 7.67.4-node16-x86_64- Node.js 16 with LibreOffice 7.47.3-node16-x86_64- Node.js 16 with LibreOffice 7.3
See Also
- aws-lambda-libreoffice - utility to work with Docker version of LibreOffice in Lambda
- libreoffica-lambda-layer - deprecated; this is the predecessor of this image