The recommended way is to write an ubuntu package, for example, with CDBS ( review , docs , examples , non-cdbs bonus ).
Then you add the $PACKAGE.sharedmimeinfo and $APPNAME.desktop to the debian / directory. The sharedmimeinfo file describes the type of file, the desktop file describes your application. The latter should contain MimeType=application/x-$APPNAME; that matches the type of file.
source share