-
-
Notifications
You must be signed in to change notification settings - Fork 61
Ubuntu Install guide
This guide is designed for Ubuntu 22.04/24.04 LTS and derivatives (Linux Mint, Elementary OS, Pop!_OS, etc.). Using this guide on Debian or other Linux distributions might require adjustments.
Minimum Requirements:
- PHP 8.3+ (recommended)
- MariaDB 10.6+ or MySQL 8+
- 4GB RAM minimum (16GB+ recommended)
- 50GB+ disk space (SSD recommended)
Note: Commands shown in grey boxes should be typed in your terminal.
- Update Operating System
- Install Prerequisites
- Add PHP Repository
- Install PHP
- Install MariaDB
- Configure MariaDB
- Install Web Server
- Configure PHP
- Install Extra Software
- Clone NNTmux
- Configure NNTmux
- Install Search Engine
- Start Indexing
- Additional Configuration
Update all packages and reboot:
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo rebootInstall required tools:
sudo apt install -y software-properties-common git make curl wget unzipNNTmux requires PHP 8.3+. If your distribution doesn't include it, add the Ondřej PPA:
sudo add-apt-repository ppa:ondrej/php
sudo apt updateInstall PHP 8.3 and all required extensions:
sudo apt install -y php8.3-cli php8.3-dev php8.3-common php8.3-curl \
php8.3-gd php8.3-mysql php8.3-mbstring php8.3-xml php8.3-intl \
php8.3-fpm php8.3-bcmath php8.3-zip php8.3-imagick php8.3-redis \
php-pear redis-serverVerify installation:
php -vVisit https://mariadb.org/download/?t=repo-config to get the correct repository for your Ubuntu version.
For Ubuntu 24.04 (Noble):
sudo apt install -y apt-transport-https curl
sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'Create repository configuration:
sudo tee /etc/apt/sources.list.d/mariadb.sources <<EOF
# MariaDB 11.4 repository
X-Repolib-Name: MariaDB
Types: deb
URIs: https://deb.mariadb.org/11.4/ubuntu
Suites: noble
Components: main main/debug
Signed-By: /etc/apt/keyrings/mariadb-keyring.pgp
EOFNote: Change
nobletojammyfor Ubuntu 22.04.
Install MariaDB:
sudo apt update
sudo apt install -y mariadb-server mariadb-clientSecure the installation:
sudo mysql_secure_installationFind your configuration file location:
mysqld -v --help | grep -A 1 'Default options'Edit the configuration:
sudo nano /etc/mysql/mariadb.conf.d/99-nntmux.cnfAdd the following configuration (adjust innodb_buffer_pool_size based on your RAM):
[mysqld]
# Connection settings
max_allowed_packet = 16M
max_connections = 200
wait_timeout = 600
interactive_timeout = 600
# InnoDB settings
innodb_buffer_pool_size = 2G # 50-70% of available RAM
innodb_buffer_pool_instances = 4
innodb_log_file_size = 512M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
# Query settings
group_concat_max_len = 8192
tmp_table_size = 256M
max_heap_table_size = 256M
# Disable query cache (deprecated)
query_cache_type = 0
query_cache_size = 0Restart MariaDB:
sudo systemctl restart mariadbConnect to MariaDB:
sudo mysql -u root -pCreate the database and user (replace the placeholders):
-- Create database
CREATE DATABASE nntmux CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Create user (replace 'YourPassword' with a strong password)
CREATE USER 'nntmux'@'localhost' IDENTIFIED BY 'YourPassword';
-- Grant privileges
GRANT ALL PRIVILEGES ON nntmux.* TO 'nntmux'@'localhost';
FLUSH PRIVILEGES;
-- Exit
EXIT;Choose either Nginx (recommended) or Apache. Do not install both.
Install Nginx:
sudo apt install -y nginxCreate NNTmux site configuration:
sudo nano /etc/nginx/sites-available/nntmuxPaste the following (adjust server_name as needed):
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
root /var/www/nntmux/public;
index index.php index.html;
access_log /var/log/nginx/nntmux-access.log;
error_log /var/log/nginx/nntmux-error.log;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
# Static files caching
location ~* \.(?:css|js|gif|ico|jpe?g|png|svg|woff2?|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Covers directory
location ^~ /covers/ {
alias /var/www/nntmux/storage/covers/;
}
# PHP handling
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 300;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
# Deny access to sensitive files
location ~ /\.(?!well-known) {
deny all;
}
}Enable the site:
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/nntmux /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl restart php8.3-fpmInstall Apache:
sudo apt install -y apache2 libapache2-mod-php8.3Create NNTmux site configuration:
sudo nano /etc/apache2/sites-available/nntmux.confPaste the following:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /var/www/nntmux/public
<Directory /var/www/nntmux/public>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Alias /covers /var/www/nntmux/storage/covers
<Directory /var/www/nntmux/storage/covers>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/nntmux-error.log
CustomLog ${APACHE_LOG_DIR}/nntmux-access.log combined
</VirtualHost>Enable the site:
sudo a2dissite 000-default
sudo a2ensite nntmux.conf
sudo a2enmod rewrite
sudo systemctl restart apache2sudo usermod -a -G www-data $USERLog out and back in for group changes to take effect:
exit
# Log back insudo nano /etc/php/8.3/cli/php.iniUpdate these settings:
max_execution_time = 120
memory_limit = 2048M
date.timezone = Europe/Belgrade ; Change to your timezone
error_reporting = E_ALL
log_errors = OnFind your timezone at: https://www.php.net/manual/en/timezones.php
sudo nano /etc/php/8.3/fpm/php.iniApply the same settings as CLI, plus:
upload_max_filesize = 100M
post_max_size = 100MRestart PHP-FPM:
sudo systemctl restart php8.3-fpmIf using Apache:
sudo nano /etc/php/8.3/apache2/php.iniApply the same settings, then restart:
sudo systemctl restart apache2sudo apt install -y p7zip-full mediainfo lame ffmpeg tmuxThe repository version is outdated. Install the latest:
mkdir -p ~/unrar_install && cd ~/unrar_install
wget https://www.rarlab.com/rar/rarlinux-x64-701.tar.gz
tar -xzf rarlinux-x64-701.tar.gz
sudo cp rar/unrar /usr/local/bin/
sudo chmod 755 /usr/local/bin/unrar
cd ~ && rm -rf ~/unrar_installVerify:
unrar --versioncd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --versioncurl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node --version
npm --versionCreate the web directory:
sudo mkdir -p /var/www
sudo chown $USER:www-data /var/www
cd /var/wwwClone the repository:
git clone https://github.com/NNTmux/newznab-tmux.git nntmux
cd nntmuxcp .env.example .env
nano .envUpdate these settings in your .env file:
# Application
APP_NAME=NNTmux
APP_ENV=production
APP_DEBUG=false
APP_URL=http://your-server-ip
APP_TIMEZONE=Europe/Belgrade
# Database
DB_CONNECTION=mariadb
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=nntmux
DB_USERNAME=nntmux
DB_PASSWORD=YourDatabasePassword
# NNTP Server (your Usenet provider)
NNTP_SERVER=news.your-provider.com
NNTP_PORT=563
NNTP_SSLENABLED=true
NNTP_USERNAME=your_usenet_username
NNTP_PASSWORD=your_usenet_password
NNTP_SOCKET_TIMEOUT=120
# Admin User
ADMIN_USER=admin
ADMIN_PASS=YourAdminPassword
ADMIN_EMAIL=admin@example.com
# API Keys (get these from respective services)
TMDB_API_KEY=your_tmdb_key
TVDB_API_KEY=your_tvdb_key
OMDB_API_KEY=your_omdb_key
# Cache & Queue
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redisGet free API keys from these services for better metadata:
| Service | URL | Purpose |
|---|---|---|
| TMDB | https://www.themoviedb.org/settings/api | Movies & TV |
| TVDB | https://thetvdb.com/dashboard/account/apikey | TV Shows |
| OMDB | https://www.omdbapi.com/apikey.aspx | Movie ratings |
| Trakt | https://trakt.tv/oauth/applications | User ratings |
| Fanart.tv | https://fanart.tv/get-an-api-key/ | Artwork |
| GiantBomb | https://www.giantbomb.com/api/ | Games |
# Set ownership
sudo chown -R $USER:www-data /var/www/nntmux
# Set directory permissions
sudo chmod -R 755 /var/www/nntmux
sudo chmod -R 775 /var/www/nntmux/storage
sudo chmod -R 775 /var/www/nntmux/bootstrap/cache
sudo chmod -R 775 /var/www/nntmux/resources/tmp
sudo chmod -R 775 /var/www/nntmux/publicphp artisan nntmux:installFollow the prompts to complete setup.
Choose ManticoreSearch (recommended) or Elasticsearch.
Install ManticoreSearch:
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
sudo apt install -y manticore manticore-columnar-libCopy configuration:
sudo cp /var/www/nntmux/misc/manticoresearch/manticore.conf /etc/manticoresearch/manticore.confCreate directories:
sudo mkdir -p /var/lib/manticore/data
sudo mkdir -p /var/log/manticore
sudo chown -R manticore:manticore /var/lib/manticore /var/log/manticoreStart service:
sudo systemctl enable manticore
sudo systemctl start manticorePopulate indexes:
cd /var/www/nntmux
php artisan nntmux:populate --manticore --releases
php artisan nntmux:populate --manticore --predbFollow the official guide: https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html
Then configure NNTmux:
php artisan nntmux:create-es-indexes
php artisan nntmux:populate --elastic --releases
php artisan nntmux:populate --elastic --predbAdd to .env:
ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOST=127.0.0.1
ELASTICSEARCH_PORT=9200Run the included installation script:
cd /var/www/nntmux
./install_tmux.sh- Open your browser and go to:
http://your-server-ip/admin/tmux-edit - Review and configure all settings
- Click Save Tmux Settings
cd /var/www/nntmux
php artisan tmux:start| Command | Description |
|---|---|
tmux att |
Reconnect to tmux session |
Ctrl+A, D |
Detach from tmux |
php artisan tmux:stop |
Stop processing |
Edit .env to configure IRC settings:
SCRAPE_IRC_ENABLED=true
SCRAPE_IRC_SERVER=irc.synirc.net
SCRAPE_IRC_PORT=6697
SCRAPE_IRC_TLS=true
SCRAPE_IRC_USERNAME=YourUniqueNicknameEnable "Scrape IRC Channels" in Admin → Tmux Settings.
Add the Laravel scheduler to cron:
crontab -eAdd this line:
* * * * * cd /var/www/nntmux && php artisan schedule:run >> /dev/null 2>&1
Ensure Redis is running:
sudo systemctl enable redis-server
sudo systemctl start redis-serverInstall Certbot for free SSL:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.comCreate log rotation for NNTmux:
sudo nano /etc/logrotate.d/nntmux/var/www/nntmux/storage/logs/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0664 www-data www-data
}
500 Internal Server Error:
tail -f /var/www/nntmux/storage/logs/laravel.log
php artisan config:clear
php artisan cache:clearPermission Denied:
sudo chown -R $USER:www-data /var/www/nntmux/storage
sudo chmod -R 775 /var/www/nntmux/storageDatabase Connection Failed:
mysql -u nntmux -p nntmux
# Test if you can connectPHP Extensions Missing:
php -m | grep -i extension_name
sudo apt install php8.3-extensionname# Clear all caches
php artisan optimize:clear
# Test NNTP connection
php artisan nntmux:test-nntp
# Test API keys
php artisan nntmux:test-apis
# View logs
tail -f storage/logs/laravel.log- Discord: Join Server
- IRC: Server Synirc, channel #tmux
- GitHub Issues: Report Bugs
- Wiki: Full Documentation