Installation and Setup
Relevant source files
The following files were used as context for generating this wiki page:
This page provides a technical overview of the installation, environment requirements, and setup procedures for the Nextcloud CAD Viewer. The app integrates the @mlightcad/cad-viewer library into the Nextcloud ecosystem to enable browser-based rendering of DWG and DXF files.
The installation process covers multiple paths: the automated Nextcloud App Store method, manual archive extraction, and a Git-based development installation. Each path ensures the underlying PHP backend and Vue.js frontend are correctly configured to handle CAD data streams through Nextcloud's file permissions system. For post-setup verification, see the Troubleshooting section.
Sources: README.md:1-10, wiki/Installation-Guide.md:1-10, appinfo/info.xml:8-15
System Requirements
The application requires specific server-side and client-side environments to function correctly, particularly regarding PHP extensions for file handling and browser WebGL support for rendering.
Server-Side Requirements
| Component | Minimum Version | Recommended |
|---|---|---|
| Nextcloud | 33 | 33 |
| PHP | 8.2+ | 8.5+ |
| Database | MySQL 8.0 / MariaDB 10.5 | PostgreSQL 13+ |
| Node.js | 20 (Runtime) / 24 (Dev) | 24+ |
Sources: wiki/Requirements.md:11-20, wiki/Installation-Guide.md:20-30, package.json:10-13, composer.json:15-17
PHP Dependencies and Extensions
The backend relies on the following extensions for processing CAD metadata and streaming content:
- Image/MIME Processing:
gdorimagick,fileinfo. - Data Handling:
json,libxml,dom,xml,zip. - Network/Security:
curl,openssl,mbstring.
Sources: wiki/Requirements.md:33-45, wiki/Installation-Guide.md:40-48
Installation Methods
Method 1: Nextcloud App Store (Recommended)
This is the standard production deployment method. It utilizes the Nextcloud administrative interface to download and enable the app automatically.
Method 2: Manual and Development Installation
For environments without App Store access or for development purposes, the app can be installed via Git. This requires building frontend assets manually.
- Clone and Permissions: Clone the repository into the Nextcloud
apps/directory and set web server ownership.git clone https://github.com/ashcoft/nextcloud-cad-viewer.git cad_viewer chown -R www-data:www-data cad_viewer - Backend Dependencies: Use Composer to install PHP requirements.
composer install --no-dev - Frontend Build: Install Node dependencies and run the production build.
Note: Thenpm install --legacy-peer-deps npm run build--legacy-peer-depsflag is required due to peer dependency conflicts in @mlightcad packages.
Sources: wiki/Installation-Guide.md:95-155, README.md:32-50, AGENTS.md:22-26
Configuration and Integration
MIME Type Association
To ensure Nextcloud and the web server recognize CAD files correctly, the following associations must be verified in the server configuration (Apache or Nginx):
| Format | Extension | Recommended MIME Types |
|---|---|---|
| DWG | .dwg | application/acad, image/vnd.dwg |
| DXF | .dxf | application/dxf, image/vnd.dxf |
Sources: wiki/Installation-Guide.md:180-205, README.md:68-75, wiki/Requirements.md:120-135
PHP Resource Limits
For handling large CAD files (up to 500MB), the php.ini and Nextcloud config.php should be adjusted:
memory_limit: 1GB recommended.upload_max_filesize: 500M.max_execution_time: 300 seconds.
Sources: wiki/Installation-Guide.md:208-220, wiki/Requirements.md:24-30
Architecture and Data Flow
The app operates by intercepting requests for CAD file types and initializing a Vue.js application that mounts the @mlightcad/cad-viewer component.
Post-Installation Verification
- App Status: Run
occ app:list | grep cad_viewerto confirm the app is enabled. - Maintenance: Run
occ maintenance:repairandocc maintenance:update:themeto clear caches. - MIME Check: Ensure
.dwgand.dxfare listed under Settings → Administration → File handling.
Sources: wiki/Installation-Guide.md:225-245, README.md:160-165
Conclusion
Successful setup of the Nextcloud CAD Viewer requires a combination of correct PHP environment variables, web server MIME type definitions, and a successful build of the Vue.js frontend assets. Once installed, the app integrates natively with the Nextcloud Files app to provide a seamless viewing experience.