You can configure automatically start and stop Oracle XE 18c database on operating system startup and shutdown. See details from installation guide.
I did install XE 18c on CentOs 7 and executed steps mentioned in installation guide.
When viewing database alert.log after system reboot, noticed that database wasn't actually stopped properly. Processes were just killed.
I didn't investigate more why that happens on my system. For workaround I did revert steps mentioned in installation guide and created service file for systemd.
First stop XE database and revert automatically start and stop:
systemctl stop oracle-xe-18c
systemctl disable oracle-xe-18c
Create service file:
cat >> /usr/lib/systemd/system/ora-xe-18c.service << EOF
Description=Oracle 18c XE databases service
ExecStart=/opt/oracle/product/18c/dbhomeXE/bin/dbstart /opt/oracle/product/18c/dbhomeXE &
Backup and modify /etc/oratab:
cp /etc/oratab /etc/oratab.backup_`date +%Y%m%d`
sed -i 's/XE:\/opt\/oracle\/product\/18c\/dbhomeXE:N/XE:\/opt\/oracle\/product\/18c\/dbhomeXE:Y/g' /etc/oratab
Enable new service and start XE database again:
systemctl enable ora-xe-18c
systemctl start ora-xe-18c