Skip to content

Installera Nextcloud på Ubuntu 24.04 Server

Cloud Infrastructure Expert
Installera Nextcloud på Ubuntu 24.04 Server

 

 

I den här guiden går vi igenom hur du installerar Nextcloud, en populär plattform för molnlagring, på en Ubuntu 24.04-server. Denna installation kan vara särskilt användbar för användare av en VPS-server.

Förutsättningar

  • Ubuntu 24.04 installerat på din server.
  • Root-åtkomst eller sudo-rättigheter.
  • En aktiv internetanslutning.
  • Apache eller Nginx installerat som webbserver.
  • PHP 7.4 eller högre installerat.
  • MySQL eller MariaDB installerat.

Steg 1: Uppdatera systemet

Öppna terminalen och kör följande kommando för att uppdatera systempaketen:

sudo apt update && sudo apt upgrade -y

Steg 2: Installera nödvändiga beroenden

Kör följande kommando för att installera nödvändiga PHP-extensions:

sudo apt install apache2 libapache2-mod-php php php-mysql php-xml php-mbstring php-curl php-zip -y

Steg 3: Installera MySQL/MariaDB

Kör följande kommando för att installera MySQL:

sudo apt install mysql-server -y

Anslut till MySQL och skapa en databas för Nextcloud:

sudo mysql
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Steg 4: Ladda ner Nextcloud

Ladda ner den senaste versionen av Nextcloud:

wget https://download.nextcloud.com/server/releases/nextcloud-24.0.0.zip

Extrahera den nedladdade filen:

unzip nextcloud-24.0.0.zip

Flytta Nextcloud-mappen till webbserverns rotkatalog:

sudo mv nextcloud /var/www/html/

Steg 5: Ställ in rättigheterna

Sätt rättigheterna för Nextcloud-mappen:

sudo chown -R www-data:www-data /var/www/html/nextcloud
sudo chmod -R 755 /var/www/html/nextcloud

Steg 6: Konfigurera Apache för Nextcloud

Skapa en ny konfigurationsfil för Apache:

sudo nano /etc/apache2/sites-available/nextcloud.conf

Lägg till följande innehåll i filen:

<VirtualHost *:80>
        DocumentRoot "/var/www/html/nextcloud"
        ServerName your_domain_or_IP

        <Directory "/var/www/html/nextcloud">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
        CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
    </VirtualHost>

Ersätt `your_domain_or_IP` med din domän eller serverns IP-adress.

Steg 7: Aktivera moduler och starta om Apache

Kör följande kommandon för att aktivera mod_rewrite och starta om Apache:

sudo a2enmod rewrite
sudo a2ensite nextcloud
sudo systemctl restart apache2

Steg 8: Slutför installationen via webbläsaren

Navigera till följande URL i din webbläsare för att slutföra installationen av Nextcloud:

http://your_domain_or_IP/nextcloud

Avslutning

Dina Nextcloud-applikationer är nu installerade och klara för användning. Genom att använda denna metod kan du enkelt hantera din molnlagring från en VPS-server.

Windows VPS Deutschland

Windows VPS España

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.