|
| 1 | +--- |
| 2 | +id: installation-linux |
| 3 | +url: conversion/net/installation-linux |
| 4 | +title: Install GroupDocs.Conversion for .NET on Linux |
| 5 | +linkTitle: Linux Installation |
| 6 | +weight: 5 |
| 7 | +description: "Step-by-step guide to install and run GroupDocs.Conversion for .NET on Linux" |
| 8 | +keywords: |
| 9 | +productName: GroupDocs.Conversion for .NET |
| 10 | +hideChildren: False |
| 11 | +toc: True |
| 12 | +--- |
| 13 | + |
| 14 | +This article explains how to install and run **GroupDocs.Conversion for .NET** on a Linux-based system using .NET Core or .NET 5/6+. It also includes instructions for installing native dependencies that might be required when running in a headless environment. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +Ensure the following tools and packages are installed: |
| 19 | + |
| 20 | +- .NET 6.0 SDK or later: [Install .NET on Linux](https://learn.microsoft.com/en-us/dotnet/core/install/linux) |
| 21 | +- A Linux distribution such as Ubuntu, Debian, CentOS, or Alpine |
| 22 | +- `libgdiplus` and other native dependencies |
| 23 | + |
| 24 | +To install the required packages: |
| 25 | + |
| 26 | +### Ubuntu / Debian: |
| 27 | + |
| 28 | +```bash |
| 29 | +sudo apt update |
| 30 | +sudo apt install -y libgdiplus libc6-dev libx11-dev libxext-dev libxrender-dev |
| 31 | +``` |
| 32 | + |
| 33 | +### CentOS / RHEL: |
| 34 | + |
| 35 | +```bash |
| 36 | +sudo yum install -y libgdiplus libc6 libX11-devel libXext libXrender |
| 37 | +``` |
| 38 | + |
| 39 | +### Alpine (Minimal Docker / Linux Distros): |
| 40 | + |
| 41 | +```bash |
| 42 | +apk add --no-cache libgdiplus fontconfig ttf-dejavu |
| 43 | +``` |
| 44 | + |
| 45 | +> If using Alpine with Docker, check the [Build in Docker - Alpine Linux](https://docs.groupdocs.com/conversion/net/build-in-docker-alpine-linux/) article. |
| 46 | +
|
| 47 | +## Install GroupDocs.Conversion using .NET CLI |
| 48 | + |
| 49 | +In your project directory, run: |
| 50 | + |
| 51 | +```bash |
| 52 | +dotnet add package GroupDocs.Conversion |
| 53 | +``` |
| 54 | + |
| 55 | +To restore packages: |
| 56 | + |
| 57 | +```bash |
| 58 | +dotnet restore |
| 59 | +``` |
| 60 | + |
| 61 | +## Run Your Project |
| 62 | + |
| 63 | +After adding the package and restoring dependencies, build and run your application: |
| 64 | + |
| 65 | +```bash |
| 66 | +dotnet run |
| 67 | +``` |
| 68 | + |
| 69 | +## Headless Environments (Optional Fonts Setup) |
| 70 | + |
| 71 | +In Linux containers or headless setups, you may need additional fonts for proper document rendering: |
| 72 | + |
| 73 | +```bash |
| 74 | +sudo apt install -y fonts-dejavu fonts-liberation |
| 75 | +``` |
| 76 | + |
| 77 | +You can also copy custom fonts to `/usr/share/fonts` or configure `FontSettings.SetFontsFolder` in code. |
| 78 | + |
| 79 | +## Troubleshooting |
| 80 | + |
| 81 | +- If you encounter `System.TypeInitializationException` or `System.DllNotFoundException`, ensure `libgdiplus` is installed. |
| 82 | +- If font rendering is broken or content is missing, install system fonts or configure a custom font folder. |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +For Docker setups, see: |
| 87 | + |
| 88 | +- [Build in Docker](https://docs-qa.groupdocs.com/conversion/net/build-in-docker/) |
| 89 | +- [Build in Docker - Alpine Linux](https://docs-qa.groupdocs.com/conversion/net/build-in-docker-alpine-linux/) |
0 commit comments