# Installing Using Docker (Core on Linux)

> Build your own Linux container image from the core folder: a Dockerfile on the ASP.NET Core runtime image, HTTP on port 5000, a data volume, plugins, settings.

- **Product:** DS Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** DS Server > Installation Guide > Installing Using Docker (Core on Linux)
- **1471 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/installation/docker-linux/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/installation/docker-linux/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/installation/docker-linux/llms-full.txt

---

Building your own Linux image of DS Server takes a short Dockerfile: the ASP.NET Core runtime image of Microsoft plus the *core* folder of the DS Server archive. Build it yourself when you need a release that the [official image](https://docs.textcontrol.com/ds-server/installation/docker-hub/llms-full.txt) doesn't have yet, such as 5.0.2, or when your image should contain your own configuration, certificates or plugins.

The steps below build and run the image on any machine with Docker and Linux containers, including Docker Desktop on Windows and macOS.

### Prerequisites

- **Docker**, running Linux containers.
- **The DS Server archive** *DS Server 5.0.2.zip*. Licensed customers download it from their Text Control account; for an evaluation, download the trial version from the [DS Server download page](https://www.textcontrol.com/product/ds-server/download/).
- **A serial number** to register the server after it starts. See [Licensing Overview](https://docs.textcontrol.com/ds-server/overview/licensing/llms-full.txt).

### Prepare the Folder

1. Create a folder named *DSServerDocker*.
2. Extract the archive. It contains two folders, *core* with the cross-platform build and *classic* with the Windows build. Copy the *core* folder into *DSServerDocker*.
3. Open *core/hostsettings.json* and remove the HTTPS address, so that the file contains:

    ```json
    {
      "urls": "http://*:5000"
    }
    ```

    The default file also lists `https://*:5001`. Without a certificate, DS Server ends at startup with the message "Unable to configure HTTPS endpoint. No server certificate was specified". [HTTPS](https://docs.textcontrol.com/ds-server/installation/https/llms-full.txt) shows how to serve HTTPS with a certificate instead.
4. Create a file named *Dockerfile*, without an extension, in *DSServerDocker*. The folder now looks like this:

    ```text
    DSServerDocker/
        Dockerfile
        core/
            TXTextControl.DocumentServices.dll
            appsettings.json
            hostsettings.json
            ...
    ```

### Write the Dockerfile

Paste the following content into the *Dockerfile*:

```dockerfile
# ASP.NET Core Runtime 10.0 on Ubuntu 24.04
FROM mcr.microsoft.com/dotnet/aspnet:10.0

WORKDIR /app

# The Core build of DS Server
COPY ./core/ .

EXPOSE 5000

ENTRYPOINT ["dotnet", "TXTextControl.DocumentServices.dll"]
```

The Dockerfile works as follows:

- **`FROM mcr.microsoft.com/dotnet/aspnet:10.0`** starts from Microsoft's ASP.NET Core Runtime 10.0 image, which contains everything the Core build needs. DS Server 5.0 is built with .NET 10, so the .NET 8 images that version 4.x used don't work.
- **`COPY ./core/ .`** copies the files of the Core build into */app*, the working directory. DS Server writes its admin database *Admin.db* and the *logs* folder there.
- **`EXPOSE 5000`** documents the port from *hostsettings.json*.
- **`ENTRYPOINT`** starts DS Server with Kestrel, the web server of ASP.NET Core.

The official image `txtextcontrol/dsserver-core` is built from the same instructions.

### Build and Run the Image

1. Open a terminal in the *DSServerDocker* folder and build the image:

    ```bash
    docker build -t dsserver .
    ```

    On a machine with an ARM64 processor, such as a Mac with Apple silicon, build with `docker build --platform linux/amd64 -t dsserver .`. The base image exists for several processors, and Docker picks the one of the machine, but the native libraries of the Core build exist for x64 only.
2. Start a container and map port 5000:

    ```bash
    docker run -d -p 5000:5000 --name mydsserver dsserver
    ```
3. Open `http://localhost:5000` in a browser and sign in with the default credentials, user name `admin` and password `admin`. The admin portal shows its welcome page.

The console of the container shows only two lines about plugins. The messages of the web server, such as "Now listening on: <http://%5B::%5D:5000>", go to the log file in */app/logs*. Read it with:

```bash
docker exec mydsserver sh -c 'cat /app/logs/*.log'
```

Change the admin password, register your serial number and create a security profile, as described in [Installing with Official Image from Docker Hub](https://docs.textcontrol.com/ds-server/installation/docker-hub/#secure-and-license-the-server).

### Keep Data Outside the Container

*Admin.db* holds the admin password, the security profiles and the OAuth setting, and it is lost with the container. Keep it in a volume by setting its path, and the path of the logs, with environment variables. Add them to the Dockerfile:

```dockerfile
ENV LiteDbOptions__DatabaseFileName=/data/Admin.db
ENV Logging__DSServerFile__Options__FolderPath=/data/logs
```

Then mount a volume at */data* when you start the container:

```bash
docker run -d -p 5000:5000 -v dsserver-data:/data --name mydsserver dsserver
```

### Add Plugins and Configuration

Files you copy into the image become part of the installation:

- **Plugins.** Copy each plugin into its own subfolder of *core/Plugins* before you build. DS Server loads them at startup. See [Plugins](https://docs.textcontrol.com/ds-server/plugins/llms-full.txt).
- **Settings.** Change *core/appsettings.json* before you build, or set individual settings as environment variables with `ENV` or `docker run -e`. See [Configuration](https://docs.textcontrol.com/ds-server/installation/configuration/llms-full.txt).
- **Fonts.** The *core/Fonts* folder contains the fonts the Core build uses. See [Configuration](https://docs.textcontrol.com/ds-server/installation/configuration/#fonts).

### Next Steps

- [HTTPS](https://docs.textcontrol.com/ds-server/installation/https/llms-full.txt): serve the container over HTTPS with a certificate.
- [Multiple Servers with Load Balancing](https://docs.textcontrol.com/ds-server/installation/load-balancing/llms-full.txt): run several containers behind a load balancer.
- [Upgrading](https://docs.textcontrol.com/ds-server/installation/upgrading/llms-full.txt): build the image for a new release.
- [Linux](https://docs.textcontrol.com/ds-server/troubleshooting/linux/llms-full.txt): problems specific to DS Server on Linux.

---

## Nearby

- **Previous:** [Installing With Official Image From Docker Hub](https://docs.textcontrol.com/ds-server/installation/docker-hub/llms-full.txt)
- **Next:** [Installing Using Docker (Classic on Windows)](https://docs.textcontrol.com/ds-server/installation/docker-windows/llms-full.txt)
