Nextcloud: Difference between revisions

imported>Onny
Minimal installation example
imported>Onny
Running Nextcloud inside a container
Line 6: Line 6:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.nextcloud = {                                
services.nextcloud = {              
   enable = true;                            
   enable = true;                  
   package = pkgs.nextcloud24;        
   package = pkgs.nextcloud24;
   hostName = "localhost";
   hostName = "localhost";
   config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
   config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
};                                              
};
</nowiki>}}
</nowiki>}}


Line 28: Line 28:


In theory, your nextcloud has now been upgraded by one version. NixOS attempts <code>nextcloud-occ upgrade</code>, if this succeeds without problems you don't need to do anything. Check <code>journalctl</code> to make sure nothing horrible happened. Go to the <code>/settings/admin/overview</code> page in your nextcloud to see whether it recommends further processing, such as database reindexing or conversion.
In theory, your nextcloud has now been upgraded by one version. NixOS attempts <code>nextcloud-occ upgrade</code>, if this succeeds without problems you don't need to do anything. Check <code>journalctl</code> to make sure nothing horrible happened. Go to the <code>/settings/admin/overview</code> page in your nextcloud to see whether it recommends further processing, such as database reindexing or conversion.
== Tips and tricks ==
=== Use alternative web server ===
In case port 80 is already used by a different application or you're using a different web server than [[Nginx]], which is used by the Nextcloud module, you can put this service into a native [[NixOS_Containers|NixOS container]] with a separate network subnet. Regarding the minimal example above, it should work like this:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
networking.nat = {
  enable = true;
  internalInterfaces = ["ve-+"];
  externalInterface = "ens3";
};
containers.nextcloud = {
  autoStart = true;               
  privateNetwork = true;         
  hostAddress = "192.168.100.10";
  localAddress = "192.168.100.11";
  config = { config, pkgs, ... }: {
    services.nextcloud = {                   
      enable = true;                 
      package = pkgs.nextcloud24;
      hostName = "localhost";
      config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
    };
    system.stateVersion = "22.05";
    networking.firewall = {
      enable = true;
      allowedTCPPorts = [ 80 ];
    };
  };
};
</nowiki>}}
After applying this configuration, your Nextcloud instance will be available at http://192.168.100.11


== Troubleshooting ==
== Troubleshooting ==