Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. What is the best way to deploy my application in linux?
Forum Updated to NodeBB v4.3 + New Features

What is the best way to deploy my application in linux?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
linux deploy
11 Posts 6 Posters 5.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D dearqt

    Hello everyone,
    I want to deploy my app in ubuntu. How do you deploy your apps in linux, which way do you choose? Thanks in advance.

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #2

    @dearqt The natural answer would be linuxdeployqt.

    1 Reply Last reply
    0
    • D dearqt

      Hello everyone,
      I want to deploy my app in ubuntu. How do you deploy your apps in linux, which way do you choose? Thanks in advance.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #3

      @dearqt is your qt version for deployment the same as the one installed in Ubuntu? If not, it can not be messy.

      D 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @dearqt is your qt version for deployment the same as the one installed in Ubuntu? If not, it can not be messy.

        D Offline
        D Offline
        dearqt
        wrote on last edited by dearqt
        #4

        @JoeCFD How can I learn this? Which version should I use for ubuntu 22.04? So you are saying that I cannot deploy qt 5.12.12 version in ubuntu 22.04, did I get right?

        JoeCFDJ 1 Reply Last reply
        0
        • D dearqt

          @JoeCFD How can I learn this? Which version should I use for ubuntu 22.04? So you are saying that I cannot deploy qt 5.12.12 version in ubuntu 22.04, did I get right?

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #5

          @dearqt I did not mean that. Of course, you can. The default Qt version on Ubuntu 22.04 is 5.15.3. If your Qt version for development is the same, you can simply deploy your app and ask the user to install Qt 5.15.3 by themselves(provide a script for users to do it easily).

          If 5.12.12 is applied, you have to install it with your app. The better location is /opt/Qt.
          And you may want to use running time path in cmake or qmake file for all Qt libs to point to /opt/Qt/***/lib.

          D 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @dearqt I did not mean that. Of course, you can. The default Qt version on Ubuntu 22.04 is 5.15.3. If your Qt version for development is the same, you can simply deploy your app and ask the user to install Qt 5.15.3 by themselves(provide a script for users to do it easily).

            If 5.12.12 is applied, you have to install it with your app. The better location is /opt/Qt.
            And you may want to use running time path in cmake or qmake file for all Qt libs to point to /opt/Qt/***/lib.

            D Offline
            D Offline
            dearqt
            wrote on last edited by dearqt
            #6

            @JoeCFD Thank you for your answer , do you know any tutorial or guide that I can follow to deploy my app? and I did not get the part you said, ask the user to install Qt. SO even though I deploy my app and created and executable, should the user install qt?

            JoeCFDJ 1 Reply Last reply
            0
            • D dearqt

              @JoeCFD Thank you for your answer , do you know any tutorial or guide that I can follow to deploy my app? and I did not get the part you said, ask the user to install Qt. SO even though I deploy my app and created and executable, should the user install qt?

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #7

              @dearqt Check JonB's reply. The code is here:
              https://github.com/probonopd/linuxdeployqt

              I use cpack of cmake to generate deb file to deploy my app and libs.

              D 1 Reply Last reply
              1
              • JoeCFDJ JoeCFD

                @dearqt Check JonB's reply. The code is here:
                https://github.com/probonopd/linuxdeployqt

                I use cpack of cmake to generate deb file to deploy my app and libs.

                D Offline
                D Offline
                dearqt
                wrote on last edited by
                #8

                @JoeCFD Thank you.

                1 Reply Last reply
                0
                • push_backP Offline
                  push_backP Offline
                  push_back
                  wrote on last edited by
                  #9

                  Did you look at flatpak see here it's quite simple to generate your flatpak build with KDE framework as runtime (the runtime contains kde and qt framework)

                  1 Reply Last reply
                  0
                  • JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #10

                    See also the official CMake deployment API for Qt (it is currently a Technical Preview, which means it's not complete yet): https://www.qt.io/blog/cmake-deployment-api

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    1
                    • S Offline
                      S Offline
                      SimonSchroeder
                      wrote on last edited by
                      #11

                      Flatpack was already mentioned as one example. We use AppImage instead. linuxdeployqt did not include everything as expected. Hence, we use both linuxdeploy and linuxdeployqt. Here is the main part of our script:

                      #!/bin/bash
                      export VERSION=1.0.0
                      
                      echo == Remove old AppDir. ==
                      rm -rf AppDir
                      
                      echo == Generate new AppDir. ==
                      ./linuxdeploy-x86_64.AppImage --appdir=AppDir --executable=../release/MyApp --desktop-file=MyApp.desktop --icon-file=MyApp.svg
                      
                      echo == Bundle Qt libs and create AppImage. ==
                      cd AppDir
                      ../linuxdeployqt-v8-x86_64.AppImage MyApp.desktop -qmake=/opt/Qt/5.13.2/gcc_64/bin/qmake -appimage
                      
                      echo == Finish up... ==
                      mv MyApp-*-x86_64.AppImage ../MyApp-x86_64.AppImage
                      
                      echo == Done. ==
                      

                      This works well across many Linux distributions. One disadvantage is that an AppImage includes all necessary Qt libraries instead of using those installed on the system. Therefore AppImages can become quite large. But they avoid most incompatibilities of different versions of dynamic libraries.

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved