systemd Service Configuration
DeepLX can be configured as a systemd service for automatic startup, restart on failure, and easy management on Linux systems.
Automatic Setup
The systemd service is automatically installed when using the installation script :
curl -fsSL https://raw.githubusercontent.com/OwO-Network/DeepLX/main/install.sh | bash
This will:
Download the systemd service file to /etc/systemd/system/deeplx.service
Reload the systemd daemon
Enable the service to start on boot
Start the DeepLX service
Manual Setup
If you prefer to set up the systemd service manually:
Create the service file
Download the official service file: sudo wget -O /etc/systemd/system/deeplx.service https://raw.githubusercontent.com/OwO-Network/DeepLX/main/deeplx.service
Or create it manually: /etc/systemd/system/deeplx.service
[Unit]
Description =DeepLX Service
After =network.target
[Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx
[Install]
WantedBy =multi-user.target
Reload systemd daemon
sudo systemctl daemon-reload
Enable and start the service
sudo systemctl enable deeplx
sudo systemctl start deeplx
Verify the service is running
sudo systemctl status deeplx
Service File Breakdown
The DeepLX systemd service file contains the following sections:
[Unit] Section
[Unit]
Description =DeepLX Service
After =network.target
Description : Human-readable description of the service
After : Ensures DeepLX starts only after the network is available
[Service] Section
[Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx
Type=simple : The process started is the main service process
Restart=always : Automatically restart the service if it crashes or stops
WorkingDirectory : Sets the working directory to /usr/bin/
ExecStart : Path to the DeepLX binary
[Install] Section
[Install]
WantedBy =multi-user.target
WantedBy : Specifies when the service should be started (at multi-user runlevel)
Customizing the Service
You can customize the service file to add environment variables, command-line options, or other configurations.
Adding Environment Variables
Edit the service file
sudo systemctl edit --full deeplx
Add environment variables
Modify the [Service] section: [Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
Environment = "IP=0.0.0.0"
Environment = "PORT=1188"
Environment = "TOKEN=your_token_here"
Environment = "DL_SESSION=your_session_here"
Environment = "PROXY=http://proxy:8080"
ExecStart =/usr/bin/deeplx
Avoid storing sensitive tokens directly in the service file. Consider using systemd’s EnvironmentFile directive to load variables from a protected file.
Reload and restart
sudo systemctl daemon-reload
sudo systemctl restart deeplx
Using an Environment File
For better security, store environment variables in a separate file:
Create an environment file
sudo nano /etc/deeplx/config.env
Add your configuration: IP = 0.0.0.0
PORT = 1188
TOKEN = your_token_here
DL_SESSION = your_session_here
PROXY = http://proxy:8080
Secure the file
sudo chmod 600 /etc/deeplx/config.env
sudo chown root:root /etc/deeplx/config.env
Update the service file
sudo systemctl edit --full deeplx
Add EnvironmentFile to the [Service] section: [Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
EnvironmentFile =/etc/deeplx/config.env
ExecStart =/usr/bin/deeplx
Reload and restart
sudo systemctl daemon-reload
sudo systemctl restart deeplx
Adding Command-Line Options
You can also configure DeepLX using command-line flags:
[Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx --ip 0.0.0.0 --port 1188 --token mytoken
Command-line flags take precedence over environment variables.
Service Management Commands
Common systemd commands for managing the DeepLX service:
Start Service
Stop Service
Restart Service
Check Status
Enable Auto-start
Disable Auto-start
View Logs
View Recent Logs
Reload Service File
sudo systemctl start deeplx
Logging and Monitoring
Viewing Logs
DeepLX logs are managed by systemd’s journal:
Follow Logs
Recent Logs
Today's Logs
Logs Since Boot
Time Range
sudo journalctl -u deeplx -f
Shows logs in real-time (similar to tail -f) sudo journalctl -u deeplx -n 100
Shows the last 100 log entries sudo journalctl -u deeplx --since today
sudo journalctl -u deeplx -b
sudo journalctl -u deeplx --since "2026-03-01" --until "2026-03-04"
Service Status
Check the current status of the DeepLX service:
sudo systemctl status deeplx
This shows:
Service state (active/inactive)
Process ID (PID)
Memory usage
Recent log entries
Uptime information
Troubleshooting
Service Fails to Start
Check the service status
sudo systemctl status deeplx
View detailed logs
sudo journalctl -u deeplx -n 50
Verify binary exists and is executable
Should show -rwxr-xr-x permissions
Service Keeps Restarting
If the service is constantly restarting:
# Check restart count
sudo systemctl show deeplx | grep NRestarts
# View recent failures
sudo journalctl -u deeplx --since "1 hour ago"
Common causes:
Port 1188 already in use
Invalid environment variables
Missing dependencies
Incorrect file permissions
Port Already in Use
Check what’s using port 1188:
sudo lsof -i :1188
# or
sudo netstat -tulpn | grep 1188
Either stop the conflicting service or change DeepLX’s port using environment variables or command-line flags.
Advanced Configuration
Running as a Specific User
For better security, run DeepLX as a non-root user:
[Service]
Type =simple
User =deeplx
Group =deeplx
Restart =always
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx
Create the user first:
sudo useradd -r -s /bin/ false deeplx
Resource Limits
Limit resources used by the DeepLX service:
[Service]
Type =simple
Restart =always
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx
MemoryLimit =512M
CPUQuota =50%
Restart Behavior
Customize restart behavior:
[Service]
Type =simple
Restart =on-failure
RestartSec =5s
StartLimitBurst =5
StartLimitIntervalSec =60s
WorkingDirectory =/usr/bin/
ExecStart =/usr/bin/deeplx
Restart=on-failure : Only restart on failures (not clean exits)
RestartSec : Wait 5 seconds before restarting
StartLimitBurst : Maximum 5 restart attempts
StartLimitIntervalSec : Within a 60-second window
File Locations
Component Path Description Service File /etc/systemd/system/deeplx.servicesystemd service configuration Binary /usr/bin/deeplxDeepLX executable Working Directory /usr/bin/Runtime working directory Environment File /etc/deeplx/config.envOptional environment variables Logs journalctl -u deeplxsystemd journal