Installing RTL8821CE WiFi Driver on Debian 11

Friday, November 25, 2022
Reading time 3 minutes

Today I will write about a quick and quite specific tip for my setup. I have now configured a mini PC as a server (mainly media, although I will be putting other additions to help at home). The thing is that this Mini PC, which integrates a Celeron J4125, would have internet via WiFi, since I do not want to wire so much (the distance between the router and the place where the server should be is not too long, but it would require a relatively long wire, it is not something I would like for now). The router provided by the internet provider, which is Izzi, already offers dual band WiFi, and luckily the Mini pc also supports it. The idea couldn’t be simpler: WiFi on the 5 GHZ band for the server, and most other devices would use the 2.4 band, to try to avoid interference. The server would run Debian, docker, and a bunch of containers for the services I wanted to set up.

However, after installing Debian, I noticed that it was not possible to use WiFi at all. The iwconfig command did not show detected devices, so, at first, I thought it might be a problem with drivers. I installed the suggested packages (Kernel complained about some missing Realtek modules), but it still didn’t improve. So I proceeded to search to see if my specific device required some kind of configuration or install something from the sources, which is usually requested in these cases, and it did. To begin with, it was necessary to find out the exact model of the device I had. For that, luckily, you can use a command like the following:

lspci | grep Network

Which in my case, returned a response like this:

04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter

From this information we can extract that the WiFi adapter that this Mini PC has is the RTL8821CE model, which does not seem to have official support in the Linux Kernel. To install it, it is necessary to pull a git repository that contains the code of the Driver released by Realtek, and the package DKMS, acronym for Dynamic Kernel Module Support, which basically will allow to install the Driver module and will take care of recompiling it every time there is an update of the Kernel.

Building and installing the Driver

  1. Before getting started, install some required dependencies in the system where the driver will be installed:
sudo apt install bc module-assistant build-essential dkms git
  1. Clone and navigate to the driver’s git repository.
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
  1. Prepare the build:
sudo m-a prepare
  1. Perform installation of the driver module in the Kernel:
sudo ./dkms-install.sh
  1. If you want to start using the device without rebooting the system, just load the module as follows:
sudo modprobe 8821ce
  1. From this point on, the device will be visible and all commands that list the devices will also start displaying their information, and you will be able to establish connection and scan networks.

Linux Administration NAS tutorials

NAS dkms Linux Kernel driver RTL8821CE