[{"data":1,"prerenderedAt":119},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-gotenberg-on-a-vps-pdf-generation-api-for-developers-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"slugs":9,"title":12,"excerpt":13,"readTime":14,"views":15,"isPinned":16,"publishedAt":17,"category":18,"categories":23,"featuredImage":25,"bgImage":26,"posterImage":27,"relatedSolution":28,"intro":31,"sections":32,"ctaTitle":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},275,"self-host-gotenberg-on-a-vps-pdf-generation-api-for-developers",{"fr":10,"en":8,"ar":11},"heberger-gotenberg-vps","استضافة-gotenberg-على-vps-واجهة-توليد-pdf-للمطورين","Self-Host Gotenberg on a VPS: PDF Generation API for Developers","Deploy Gotenberg on your VPS for a self-hosted PDF generation API — HTML, URLs and LibreOffice documents to PDF with one REST call. No per-page billing.",4,0,false,"2026-01-16T00:00:00+00:00",{"id":14,"name":19,"slug":20,"color":21,"icon":22},"Development","developpement","bg-warning\u002F10 text-warning","dev",[24],{"id":14,"name":19,"slug":20,"color":21,"icon":22},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-gotenberg-vps-poster.svg",{"categorySlug":29,"appSlug":30},"development","gotenberg","Every SaaS PDF service charges per page or per document. Gotenberg does not — it is an open-source, MIT-licensed HTTP microservice that generates PDFs from HTML, URLs, Markdown and LibreOffice documents, with Chromium and LibreOffice bundled in a single Docker container. Here is how to deploy it on a VPS in minutes.",[33,37,47,50,69],{"type":34,"title":35,"body":36},"h2","Why self-host a PDF generation API?","SaaS PDF services (Puppeteer Cloud, PDFShift, DocRaptor) charge per document, per page or by API call volume. As soon as your application generates invoices, reports or contracts at scale, the cost grows linearly with your usage. Gotenberg replaces them with a fixed monthly VPS cost, regardless of how many PDFs you generate. It also keeps your documents private: nothing leaves your infrastructure during conversion.",{"type":38,"title":39,"items":40},"ul","What Gotenberg can convert",[41,42,43,44,45,46],"HTML to PDF via a full Chromium instance — CSS, web fonts, JavaScript and print media queries are all honoured.","Any URL to PDF — archive dashboard views, generate weekly reports or capture payment receipts.","LibreOffice documents (DOCX, XLSX, PPTX, ODT, ODS, ODP and 20+ formats) to PDF without installing Microsoft Office.","Markdown to PDF via the Chromium route with configurable CSS.","Multiple PDFs merged into a single file in one API call.","Images (PNG, JPEG, WebP, TIFF) converted to PDF.",{"type":34,"title":48,"body":49},"Requirements","A VPS with at least 1 vCPU and 1 GB RAM (2 GB recommended for concurrent Chromium rendering). Ubuntu 22.04 or 24.04 with Docker installed. No domain is needed — you can call the API on `http:\u002F\u002F127.0.0.1:3000` from your backend application on the same server, or expose it to your internal network only.",{"type":51,"title":52,"steps":53},"steps","Deploy Gotenberg step by step",[54,57,60,63,66],{"title":55,"body":56},"Create the compose file","SSH into your VPS and create a directory:\n```\nmkdir gotenberg && cd gotenberg\n```\nCreate `docker-compose.yml`:\n```yaml\nservices:\n  gotenberg:\n    image: gotenberg\u002Fgotenberg:8\n    restart: unless-stopped\n    ports:\n      - \"127.0.0.1:3000:3000\"\n```\nBinding to `127.0.0.1` prevents direct access from the internet — the API is only reachable from your application on the same server or via a reverse proxy.",{"title":58,"body":59},"Start the container","Run `docker compose up -d`. Gotenberg pulls the image (~1.5 GB, includes Chromium and LibreOffice) and starts the HTTP server. Check the health endpoint:\n```\ncurl http:\u002F\u002F127.0.0.1:3000\u002Fhealth\n```\nA `{\"status\":\"up\"}` response confirms the service is ready.",{"title":61,"body":62},"Generate your first PDF from HTML","Create a minimal HTML file (`invoice.html`) and convert it:\n```\ncurl -s --request POST http:\u002F\u002F127.0.0.1:3000\u002Fforms\u002Fchromium\u002Fconvert\u002Fhtml \\\n  --form 'index.html=@invoice.html' \\\n  -o invoice.pdf\n```\nThe response is the PDF as a binary stream — pipe it to a file, a response object, or an S3 upload.",{"title":64,"body":65},"Convert a Word document to PDF","Upload a DOCX file to the LibreOffice route:\n```\ncurl -s --request POST http:\u002F\u002F127.0.0.1:3000\u002Fforms\u002Flibreoffice\u002Fconvert \\\n  --form 'files=@contract.docx' \\\n  -o contract.pdf\n```\nGotenberg uses the embedded LibreOffice engine for conversion — no Microsoft Office licence required.",{"title":67,"body":68},"Add authentication (recommended)","Gotenberg has no built-in auth. The recommended approach: install nginx, create a reverse proxy from `https:\u002F\u002Fgotenberg.your-domain.com` to `http:\u002F\u002F127.0.0.1:3000`, and add HTTP basic auth. Only your application's backend should call this endpoint — never expose it unauthenticated to the public internet, as it can be abused to render arbitrary URLs.",{"type":34,"title":70,"body":71},"Integrate with your application","Gotenberg is language-agnostic — any HTTP client works. Libraries exist for PHP (`gotenberg-php`), Node.js (`chromiumly`), Python (`gotenberg-client`), Go and others. For Laravel, a first-party package wraps the API. In Node.js, you can call it with `axios` or the native `fetch` API by POSTing a `FormData` object with the HTML content or file.","Deploy Gotenberg on a ServOrbit Cloud VPS in minutes","With a ServOrbit Cloud VPS you get Docker preconfigured and scalable RAM — the right base for Gotenberg to handle Chromium rendering and LibreOffice conversion without resource contention.","Launch my Cloud VPS","\u002Fmarketplace\u002Fdevelopment\u002Fgotenberg",[77,99],{"id":78,"slug":79,"slugs":80,"title":83,"excerpt":84,"readTime":85,"views":15,"isPinned":16,"publishedAt":86,"category":87,"categories":93,"featuredImage":25,"bgImage":26,"posterImage":95,"relatedSolution":96},178,"self-host-stirling-pdf-on-a-vps-50-pdf-operations-no-cloud",{"fr":81,"en":79,"ar":82},"self-host-stirling-pdf-vps","استضافة-stirling-pdf-على-vps-أكثر-من-50-عملية-بلا-سحابة","Self-Host Stirling PDF on a VPS: 50+ PDF Operations, No Cloud","Self-host Stirling PDF on a VPS — the #1 PDF app on GitHub (87 k stars, MIT). Merge, split, compress, convert, OCR and 50+ operations. No cloud upload, no subscription.",6,"2026-07-13T00:00:00+00:00",{"id":88,"name":89,"slug":90,"color":91,"icon":92},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[94],{"id":88,"name":89,"slug":90,"color":91,"icon":92},"\u002Fblog\u002Fcovers\u002Fself-host-stirling-pdf-vps-poster.svg",{"categorySlug":97,"appSlug":98},"collaboration-productivity","stirling-pdf",{"id":100,"slug":101,"slugs":102,"title":105,"excerpt":106,"readTime":14,"views":15,"isPinned":16,"publishedAt":107,"category":108,"categories":113,"featuredImage":25,"bgImage":26,"posterImage":115,"relatedSolution":116},61,"hosting-appwrite-on-a-vps",{"fr":103,"en":101,"ar":104},"heberger-appwrite-vps","استضافة-appwrite-على-خادم-vps","Hosting Appwrite on a VPS","Self-host Appwrite on your Cloud VPS: a complete BaaS backend in Docker for web and mobile apps, compared to Supabase.","2026-04-20T00:00:00+00:00",{"id":85,"name":109,"slug":110,"color":111,"icon":112},"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[114],{"id":85,"name":109,"slug":110,"color":111,"icon":112},"\u002Fblog\u002Fcovers\u002Fheberger-appwrite-vps-poster.svg",{"categorySlug":117,"appSlug":118},"databases","appwrite",1787581012225]