Lock bootloader on lineage os

If you look at graphene os or calyx os website, you will see that you can lock the bootloader after installing these roms. As you may know, unlocked bootloader is a security risk. The worst thing about these roms is that these are only for google pixel. Is there any way to install lineage os on my phone and lock the bootloader again?

Almost definitely not, this thread provides some explanation as to why (TL;DR Lineage is basically built from the group up to run with an unlocked bootloader, and it would be difficult to change that):

I think this thread does downplay some of the security issues with having an unlocked bootloader, it seems to assume the only attacks a locked bootloader prevents are physical hands-on-the-device attacks, which isn’t true; but it gives you an overview of the design decisions behind LineageOS.

The biggest barrier isn’t even LineageOS though, it’s your device. You didn’t share what device you have, but most don’t support custom bootloader keys and relocking with a custom ROM in the first place, so whether the ROM supports relocking is actually irrelevant.

If your device happens to support it, and it’s not a Google Pixel, your best bet is using DivestOS which is Lineage based with additional security features and the ability to relock your bootloader. Very dependent on your device’s support though.

Depends on the actual device. Most devices do NOT allow you to add your own signing key. Without this, you can NOT lock the bootloader, unless it is the original ROM.

You might be able to do this on a couple of devices, but not all of them.